]> git.hungrycats.org Git - linux/commitdiff
extcon: unregister compat link on cleanup
authorPeter Huewe <peterhuewe@gmx.de>
Mon, 24 Sep 2012 06:36:24 +0000 (15:36 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Oct 2012 17:10:00 +0000 (10:10 -0700)
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>
drivers/extcon/extcon_class.c

index 6e914d030a467695e437eb87aa8128026f05eb7a..7dcfb7c62eec14158b6db4b688ba553eedac1c7b 100644 (file)
@@ -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);
        }