Commit 707d7550 authored by Chanwoo Choi's avatar Chanwoo Choi

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: default avatarChanwoo Choi <cw00.choi@samsung.com>
parent 71c3ffa5
...@@ -1046,6 +1046,15 @@ struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index) ...@@ -1046,6 +1046,15 @@ struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index)
#endif /* CONFIG_OF */ #endif /* CONFIG_OF */
EXPORT_SYMBOL_GPL(extcon_get_edev_by_phandle); EXPORT_SYMBOL_GPL(extcon_get_edev_by_phandle);
/**
* extcon_get_edev_name() - Get the name of the extcon device.
* @edev: the extcon device
*/
const char *extcon_get_edev_name(struct extcon_dev *edev)
{
return !edev ? NULL : edev->name;
}
static int __init extcon_class_init(void) static int __init extcon_class_init(void)
{ {
return create_extcon_class(); return create_extcon_class();
......
...@@ -259,6 +259,10 @@ extern int extcon_unregister_notifier(struct extcon_dev *edev, ...@@ -259,6 +259,10 @@ extern int extcon_unregister_notifier(struct extcon_dev *edev,
* This function use phandle of devicetree to get extcon device directly. * This function use phandle of devicetree to get extcon device directly.
*/ */
extern struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index); extern struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index);
/* Following API to get information of extcon device */
extern const char *extcon_get_edev_name(struct extcon_dev *edev);
#else /* CONFIG_EXTCON */ #else /* CONFIG_EXTCON */
static inline int extcon_dev_register(struct extcon_dev *edev) static inline int extcon_dev_register(struct extcon_dev *edev)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment