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 <wulf@rock-chips.com>
This commit is contained in:
Wu Liang feng
2016-07-06 10:08:56 +08:00
committed by Huang, Tao
parent 62b5ed622d
commit e8f0a9830b

View File

@@ -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;