aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPeter Huewe <peterhuewe@gmx.de>2012-09-24 15:36:24 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-31 10:10:00 -0700
commit3ed2bcc63a56f5b8983ecfc4de37fa70d7e2e380 (patch)
treee10d0d8a8d1f1f5ff6f04f1e3af345941f067611 /drivers
parentc5a2edcb66a0f15a5313b52dd68821ec387d8091 (diff)
extcon: unregister compat link on cleanup
commit 824a1bc045cef278aec15bef35d8d0b59ce77856 upstream. Since extcon registers this compat link at device registration (extcon_dev_register), we should probably remove them at deregistration/cleanup. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers')
-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 6e914d030a46..7dcfb7c62eec 100644
--- a/drivers/extcon/extcon_class.c
+++ b/drivers/extcon/extcon_class.c
@@ -575,6 +575,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);
}