Skip to contentSkip to conversation

extcon: Mark extcon_get_edev_name() function as exported symbol

PATCH Applied Mayank Rana 2 participants 2 messages Mar 16, 2020 – Mar 18, 2020 External connector subsystem (extcon)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 extcon: Mark extcon_get_edev_name() function as exported symbol

extcon_get_edev_name() function provides client driver to request extcon dev's name. If extcon driver and client driver are compiled as loadable modules, extcon_get_edev_name() function symbol is not visible to client driver. Hence mark extcon_find_edev_name() function as exported symbol.

---
 drivers/extcon/extcon.c | 1 +
 include/linux/extcon.h  | 5 +++++
 2 files changed, 6 insertions(+)
drivers/extcon/extcon.c +1 -0
index e055893..2dfbfec 100644
@@ -1406,6 +1406,7 @@ const char *extcon_get_edev_name(struct extcon_dev *edev)
 {
 	return !edev ? NULL : edev->name;
 }
+EXPORT_SYMBOL_GPL(extcon_get_edev_name);
 
 static int __init extcon_class_init(void)
 {
include/linux/extcon.h +5 -0
index 1b1d77e..fd183fb 100644
@@ -286,6 +286,11 @@ static inline struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev,
 {
 	return ERR_PTR(-ENODEV);
 }
+
+static inline const char *extcon_get_edev_name(struct extcon_dev *edev)
+{
+	return NULL;
+}
 #endif /* CONFIG_EXTCON */
 
 /*
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
maintainer Applied
#1 lore raw
Quoted 31 lines · Mayank Rana

extcon_get_edev_name() function provides client driver to request extcon dev's name. If extcon driver and client driver are compiled as loadable modules, extcon_get_edev_name() function symbol is not visible to client driver. Hence mark extcon_find_edev_name() function as exported symbol.

---
 drivers/extcon/extcon.c | 1 +
 include/linux/extcon.h  | 5 +++++
 2 files changed, 6 insertions(+)
drivers/extcon/extcon.c +1 -0
index e055893..2dfbfec 100644
@@ -1406,6 +1406,7 @@ const char *extcon_get_edev_name(struct extcon_dev *edev)
 {
 	return !edev ? NULL : edev->name;
 }
+EXPORT_SYMBOL_GPL(extcon_get_edev_name);
 
 static int __init extcon_class_init(void)
 {
include/linux/extcon.h +0 -0
index 1b1d77e..fd183fb 100644
@@ -286,6 +286,11 @@ static inline struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev,
 {

include/linux/extcon.h static inline struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, · line 296

Quoted 10 lines
include/linux/extcon.h +5 -0
 	return ERR_PTR(-ENODEV);
 }
+
+static inline const char *extcon_get_edev_name(struct extcon_dev *edev)
+{
+	return NULL;
+}
 #endif /* CONFIG_EXTCON */
 
 /*

Applied it. Thanks.

Signature · 3 lines
Best Regards,
Chanwoo Choi
Samsung Electronics