[ 036/101] extcon: unregister compat link on cleanup

From: Greg Kroah-Hartman
Date: Mon Oct 29 2012 - 18:14:08 EST


3.6-stable review patch. If anyone has any objections, please let me know.

------------------

From: Peter Huewe <peterhuewe@xxxxxx>

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@xxxxxx>
Signed-off-by: Chanwoo Choi <cw00.choi@xxxxxxxxxxx>

---
drivers/extcon/extcon_class.c | 4 ++++
1 file changed, 4 insertions(+)

--- a/drivers/extcon/extcon_class.c
+++ b/drivers/extcon/extcon_class.c
@@ -575,6 +575,10 @@ static void extcon_cleanup(struct extcon
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);
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/