Skip to contentSkip to conversation

physmap_of: ensure versatile code is reachable

PATCH In review Arnd Bergmann 3 participants 3 messages Apr 25, 2016 – Apr 27, 2016 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 physmap_of: ensure versatile code is reachable

With the newly added physmap_of_versatile code, we get a build error when physmap_of is in a module, because of_flash_probe_versatile is not exported:

ERROR: "of_flash_probe_versatile" [drivers/mtd/maps/physmap_of.ko] undefined!

This adds the export, and changes the Makefile so that the code is also put into a loadable module rather than built-in when physmap_of itself is a module.

---
 drivers/mtd/maps/Makefile               | 4 +++-
 drivers/mtd/maps/physmap_of_versatile.c | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/mtd/maps/Makefile +3 -1
index 188873a..644f7d3 100644
@@ -18,7 +18,9 @@ obj-$(CONFIG_MTD_TSUNAMI)	+= tsunami_flash.o
 obj-$(CONFIG_MTD_PXA2XX)	+= pxa2xx-flash.o
 obj-$(CONFIG_MTD_PHYSMAP)	+= physmap.o
 obj-$(CONFIG_MTD_PHYSMAP_OF)	+= physmap_of.o
-obj-$(CONFIG_MTD_PHYSMAP_OF_VERSATILE) += physmap_of_versatile.o
+ifdef CONFIG_MTD_PHYSMAP_OF_VERSATILE
+obj-$(CONFIG_MTD_PHYSMAP_OF)	+= physmap_of_versatile.o
+endif
 obj-$(CONFIG_MTD_PISMO)		+= pismo.o
 obj-$(CONFIG_MTD_PMC_MSP_EVM)   += pmcmsp-flash.o
 obj-$(CONFIG_MTD_PCMCIA)	+= pcmciamtd.o
drivers/mtd/maps/physmap_of_versatile.c +2 -0
index fa40539..0f39b2a 100644
@@ -19,6 +19,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
  */
+#include <linux/export.h>
 #include <linux/io.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -251,3 +252,4 @@ int of_flash_probe_versatile(struct platform_device *pdev,
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(of_flash_probe_versatile);
Signature · 1 line
2.7.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Arnd Bergmann

With the newly added physmap_of_versatile code, we get a build error when physmap_of is in a module, because of_flash_probe_versatile is not exported:

ERROR: "of_flash_probe_versatile" [drivers/mtd/maps/physmap_of.ko] undefined!

This adds the export, and changes the Makefile so that the code is also put into a loadable module rather than built-in when physmap_of itself is a module.

Argh how stupid of me. Strange I didn't see it on the build servers. Anyway:

Yours,
Linus Walleij

Acked-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 11 lines · Arnd Bergmann

With the newly added physmap_of_versatile code, we get a build error when physmap_of is in a module, because of_flash_probe_versatile is not exported:

ERROR: "of_flash_probe_versatile" [drivers/mtd/maps/physmap_of.ko] undefined!

This adds the export, and changes the Makefile so that the code is also put into a loadable module rather than built-in when physmap_of itself is a module.

I presume you're taking this in arm-soc.