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>
This commit is contained in:
Peter Huewe 2012-09-24 15:36:24 +09:00 committed by MyungJoo Ham
parent 0dc77b6dab
commit 824a1bc045
1 changed files with 4 additions and 0 deletions

View File

@ -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);
}