summaryrefslogtreecommitdiff
path: root/drivers/extcon
diff options
context:
space:
mode:
authorPeter Huewe <peterhuewe@gmx.de>2012-09-24 15:36:24 +0900
committerMyungJoo Ham <myungjoo.ham@samsung.com>2012-10-23 16:32:12 +0900
commit824a1bc045cef278aec15bef35d8d0b59ce77856 (patch)
tree752b136da5bfdc0b4d3f20ab0119470f5f2fdd49 /drivers/extcon
parent0dc77b6dabec8fd298392018cc0de5214af2dc43 (diff)
downloadlinux-3.10-824a1bc045cef278aec15bef35d8d0b59ce77856.tar.gz
linux-3.10-824a1bc045cef278aec15bef35d8d0b59ce77856.tar.bz2
linux-3.10-824a1bc045cef278aec15bef35d8d0b59ce77856.zip
extcon: unregister compat link on cleanup
Since extcon registers this compat link at device registration (extcon_dev_register), we should probably remove them at deregistration/cleanup. Cc: stable@vger.kernel.org Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r--drivers/extcon/extcon-class.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/extcon/extcon-class.c b/drivers/extcon/extcon-class.c
index 63715cdfe98..54dc00b7b9f 100644
--- a/drivers/extcon/extcon-class.c
+++ b/drivers/extcon/extcon-class.c
@@ -570,6 +570,10 @@ static void extcon_cleanup(struct extcon_dev *edev, bool skip)
kfree(edev->cables);
}
+#if defined(CONFIG_ANDROID)
+ if (switch_class)
+ class_compat_remove_link(switch_class, edev->dev, NULL);
+#endif
device_unregister(edev->dev);
put_device(edev->dev);
}