[PATCH] base: soc: Export soc_device_to_device() helper

Andreas Färber
2019-11-11T04:57:47Z

Use of soc_device_to_device() in driver modules causes a build failure.
Given that the helper is nicely documented in include/linux/sys_soc.h,
let's export it as GPL symbol.

struct soc_device is local to soc.c, so it can't be inlined into the
header or into driver code.

This still handles only the case that CONFIG_SOC_BUS is enabled.
Same as commit da65a1589dacc7ec44ea0557a14d70a39d991f32 ("base: soc:
Provide a dummy implementation of soc_device_match()") we'd need to
provide a dummy inline implementation to cope with COMPILE_TEST, too.

Reported-by: kbuild test robot <lkp@intel.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
drivers/base/soc.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/base/soc.c b/drivers/base/soc.c
index 4af11a423475..72848587cd51 100644
--- a/drivers/base/soc.c
+++ b/drivers/base/soc.c
@@ -41,6 +41,7 @@ struct device *soc_device_to_device(struct soc_device *soc_dev)
{
return &soc_dev->dev;
}
+EXPORT_SYMBOL_GPL(soc_device_to_device);

static umode_t soc_attribute_mode(struct kobject *kobj,
struct attribute *attr,
--
2.16.4