From: Wu Liang feng Date: Wed, 6 Jul 2016 02:08:56 +0000 (+0800) Subject: extcon: fix duplicate create switch class X-Git-Tag: firefly_0821_release~2218 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e8f0a9830b0b5432b7cfdafdce9eb933807dce14;p=firefly-linux-kernel-4.4.55.git extcon: fix duplicate create switch class If "CONFIG_ANDROID" and "CONFIG_SWITCH" are enabled, /sys/class/switch/* are created in switch classe driver, so we can't create switch class again in extcon. Change-Id: Ida627cfdbb3ecb6f0aa40af146a66897edafd2fe Signed-off-by: Wu Liang feng --- diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index 21a123cadf78..a101db469857 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -635,7 +635,7 @@ static int create_extcon_class(void) return PTR_ERR(extcon_class); extcon_class->dev_groups = extcon_groups; -#if defined(CONFIG_ANDROID) +#if defined(CONFIG_ANDROID) && !defined(CONFIG_SWITCH) switch_class = class_compat_register("switch"); if (WARN(!switch_class, "cannot allocate")) return -ENOMEM;