diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2015-04-15 00:57:51 -0400 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2015-05-19 03:39:04 -0400 |
commit | 707d7550875a9bd245ce5f1077d2d2cb44eab218 (patch) | |
tree | 22476cb6161ab33949c852836fb1329c65f77ac9 /drivers/extcon/extcon.c | |
parent | 71c3ffa5d23af0554c27010cf12710da9bf85950 (diff) |
extcon: Add extcon_get_edev_name() API to get the extcon device name
This patch adds the extcon_get_edev_name() API to get the name of extcon device
because all information inclued in the structure extcon_dev should be accessed
by extcon core API instead of directly accessing the data.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon/extcon.c')
-rw-r--r-- | drivers/extcon/extcon.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index 1a932292d6c8..c5e9ebf0a914 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c | |||
@@ -1046,6 +1046,15 @@ struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index) | |||
1046 | #endif /* CONFIG_OF */ | 1046 | #endif /* CONFIG_OF */ |
1047 | EXPORT_SYMBOL_GPL(extcon_get_edev_by_phandle); | 1047 | EXPORT_SYMBOL_GPL(extcon_get_edev_by_phandle); |
1048 | 1048 | ||
1049 | /** | ||
1050 | * extcon_get_edev_name() - Get the name of the extcon device. | ||
1051 | * @edev: the extcon device | ||
1052 | */ | ||
1053 | const char *extcon_get_edev_name(struct extcon_dev *edev) | ||
1054 | { | ||
1055 | return !edev ? NULL : edev->name; | ||
1056 | } | ||
1057 | |||
1049 | static int __init extcon_class_init(void) | 1058 | static int __init extcon_class_init(void) |
1050 | { | 1059 | { |
1051 | return create_extcon_class(); | 1060 | return create_extcon_class(); |