From: Peter Huewe Date: Mon, 24 Sep 2012 06:36:24 +0000 (+0900) Subject: extcon: unregister compat link on cleanup X-Git-Tag: firefly_0821_release~3680^2~1715^2~2^2~9 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=824a1bc045cef278aec15bef35d8d0b59ce77856;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Chanwoo Choi --- diff --git a/drivers/extcon/extcon-class.c b/drivers/extcon/extcon-class.c index 63715cdfe988..54dc00b7b9f6 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); }