From 041b82322f5e2b419b37d9ba80dcb6f6cd54cb86 Mon Sep 17 00:00:00 2001 From: Mayank Rana Date: Wed, 4 Mar 2020 15:02:23 -0800 Subject: [PATCH] BACKPORT: 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. (cherry picked from commit 995bb1092326b8ba8fa29456c334ac6a49765ccd git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git) Bug: 152643506 Change-Id: Idbeed2cf45cc201d707ccbccdd043d71e3a0c23a Signed-off-by: Mayank Rana Signed-off-by: Chanwoo Choi Signed-off-by: Greg Kroah-Hartman --- drivers/extcon/extcon.c | 1 + include/linux/extcon.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index e055893fd5c3..2dfbfec572f9 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -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) { diff --git a/include/linux/extcon.h b/include/linux/extcon.h index 2bdf643d8593..32a558b864ca 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h @@ -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 */ /*