From: Peter Huewe Date: Mon, 24 Sep 2012 06:36:24 +0000 (+0900) Subject: extcon: unregister compat link on cleanup X-Git-Tag: v3.6.5~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ed2bcc63a56f5b8983ecfc4de37fa70d7e2e380;p=thirdparty%2Fkernel%2Fstable.git 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 Signed-off-by: Chanwoo Choi --- diff --git a/drivers/extcon/extcon_class.c b/drivers/extcon/extcon_class.c index 6e914d030a467..7dcfb7c62eec1 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); }