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

From: Andreas FÃrber
Date: Sun Nov 10 2019 - 23:56:21 EST


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@xxxxxxxxx>
Cc: Lee Jones <lee.jones@xxxxxxxxxx>
Cc: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>
Cc: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
Signed-off-by: Andreas FÃrber <afaerber@xxxxxxx>
---
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