[PATCH 2/2] extcon: unregister compat link on cleanup

From: Peter Huewe
Date: Fri Sep 21 2012 - 21:36:33 EST


Since extcon registers this compat link at device registration
(extcon_dev_register), we should probably remove them at deregistration/cleanup.

Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Peter Huewe <peterhuewe@xxxxxx>
---
drivers/extcon/extcon_class.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/extcon/extcon_class.c b/drivers/extcon/extcon_class.c
index 6e914d0..7610b4e 100644
--- a/drivers/extcon/extcon_class.c
+++ b/drivers/extcon/extcon_class.c
@@ -575,6 +575,11 @@ static void extcon_cleanup(struct extcon_dev *edev, bool skip)
kfree(edev->cables);
}

+#if defined(CONFIG_ANDROID)
+ if (switch_class)
+ ret = class_compat_remove_link(switch_class, edev->dev,
+ NULL);
+#endif /* CONFIG_ANDROID */
device_unregister(edev->dev);
put_device(edev->dev);
}
--
1.7.8.6

--
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/