mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
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:
committed by
Huang, Tao
parent
62b5ed622d
commit
e8f0a9830b
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user