Skip to contentSkip to conversation

driver core: export device_is_bound() to fix build failure

PATCH Superseded Sudip Mukherjee 3 participants 3 messages Nov 6, 2020 – Nov 9, 2020 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 driver core: export device_is_bound() to fix build failure

When CONFIG_MXC_CLK_SCU is configured as 'm' the build fails as it is unable to find device_is_bound(). The error being:
ERROR: modpost: "device_is_bound" [drivers/clk/imx/clk-imx-scu.ko]
undefined!

Export the symbol so that the module finds it.

---

 drivers/base/dd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/base/dd.c +1 -0
index 148e81969e04..a796a57e5efb 100644
@@ -353,6 +353,7 @@ bool device_is_bound(struct device *dev)
 {
 	return dev->p && klist_node_attached(&dev->p->knode_driver);
 }
+EXPORT_SYMBOL(device_is_bound);
 
 static void driver_bound(struct device *dev)
 {
Signature · 1 line
2.11.0
#1 lore raw
Quoted 9 lines · Sudip Mukherjee

When CONFIG_MXC_CLK_SCU is configured as 'm' the build fails as it is unable to find device_is_bound(). The error being:
ERROR: modpost: "device_is_bound" [drivers/clk/imx/clk-imx-scu.ko]
undefined!

Export the symbol so that the module finds it.

---

What patch caused this problem? Can you resend this with a "Fixes:" line so we know where to queue it up to?

thanks,

greg k-h

#2 lore raw
In reply to Sudip Mukherjee
Quoted 18 lines · Sudip Mukherjee

When CONFIG_MXC_CLK_SCU is configured as 'm' the build fails as it is unable to find device_is_bound(). The error being:
ERROR: modpost: "device_is_bound" [drivers/clk/imx/clk-imx-scu.ko]
undefined!

Export the symbol so that the module finds it.

---

 drivers/base/dd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/base/dd.c +0 -0
index 148e81969e04..a796a57e5efb 100644

drivers/base/dd.c bool device_is_bound(struct device *dev) · line 356

Quoted 4 lines
drivers/base/dd.c +1 -0
@@ -353,6 +353,7 @@ bool device_is_bound(struct device *dev)
 {
 	return dev->p && klist_node_attached(&dev->p->knode_driver);
 }
+EXPORT_SYMBOL(device_is_bound);

Everything else in this file uses EXPORT_SYMBOL_GPL, so I don't see why this would be special.

That being said a good rationale of why it is a good idea to use this in drivers is also required.