summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangjung Woo <sangjung.woo@samsung.com>2014-04-21 19:10:08 +0900
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2015-09-18 14:58:50 +0200
commitfdbfb692db6b06b548ee7f707e64a1f7bcdab992 (patch)
treeec29dfcca85d2bba9f473c21967e79aaec2c21b0
parent0277928c1fa702411fdb75cad60f9f5856535e57 (diff)
extcon: Add resource-managed extcon register function
Add resource-managed extcon device register function for convenience. For example, if a extcon device is attached with new devm_extcon_dev_register(), that extcon device is automatically unregistered on driver detach. Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com> [Fix bug about devm_extcon_dev_match/release() and code clean by Chanwoo Choi] Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> (cherry picked from commit 1111244ff4493448c0ee66e814e20c6e81d3b93d)
-rw-r--r--include/linux/extcon.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/extcon.h b/include/linux/extcon.h
index 3492e680fbdb..36f49c405dfb 100644
--- a/include/linux/extcon.h
+++ b/include/linux/extcon.h
@@ -185,6 +185,10 @@ struct extcon_specific_cable_nb {
*/
extern int extcon_dev_register(struct extcon_dev *edev);
extern void extcon_dev_unregister(struct extcon_dev *edev);
+extern int devm_extcon_dev_register(struct device *dev,
+ struct extcon_dev *edev);
+extern void devm_extcon_dev_unregister(struct device *dev,
+ struct extcon_dev *edev);
extern struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name);
/*