From e8f0a9830b0b5432b7cfdafdce9eb933807dce14 Mon Sep 17 00:00:00 2001 From: Wu Liang feng Date: Wed, 6 Jul 2016 10:08:56 +0800 Subject: [PATCH] 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 --- drivers/extcon/extcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.34.1