All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: physmap_of: really fix the physmap add-ons
@ 2017-03-26 12:27 ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2017-03-26 12:27 UTC (permalink / raw)
  To: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, linux-mtd
  Cc: linux-arm-kernel, Linus Walleij

The current way of building the of_physmap add-ons result in just
the add-on being in the object code, and not the actual core
implementation and regress the Gemini and Versatile.

There is no way around exporting these functions. If they are
built as modules, they will become modules with exported functions,
if they are builtins they will become builtins.

Fixes: 4f04f68e1598 ("mtd: physmap_of: fixup gemini/versatile dependencies")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
The previous attempts to bake a single module from several *optional*
pieces doesn't play well with tristate, and if there is a way to
achieve that except making everything an #ifdef in the same file,
I sure haven't figured it out. I guess #include "physmap_addon.c"
directly into the C file would work but ugh that is ugly.
---
 drivers/mtd/maps/Makefile               | 8 ++------
 drivers/mtd/maps/physmap_of_gemini.c    | 2 ++
 drivers/mtd/maps/physmap_of_versatile.c | 2 ++
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile
index aef1846b4de2..608bdd37ac99 100644
--- a/drivers/mtd/maps/Makefile
+++ b/drivers/mtd/maps/Makefile
@@ -17,12 +17,8 @@ obj-$(CONFIG_MTD_CK804XROM)	+= ck804xrom.o
 obj-$(CONFIG_MTD_TSUNAMI)	+= tsunami_flash.o
 obj-$(CONFIG_MTD_PXA2XX)	+= pxa2xx-flash.o
 obj-$(CONFIG_MTD_PHYSMAP)	+= physmap.o
-ifdef CONFIG_MTD_PHYSMAP_OF_VERSATILE
-physmap_of-objs += physmap_of_versatile.o
-endif
-ifdef CONFIG_MTD_PHYSMAP_OF_GEMINI
-physmap_of-objs += physmap_of_gemini.o
-endif
+obj-$(CONFIG_MTD_PHYSMAP_OF_VERSATILE) += physmap_of_versatile.o
+obj-$(CONFIG_MTD_PHYSMAP_OF_GEMINI) += physmap_of_gemini.o
 obj-$(CONFIG_MTD_PHYSMAP_OF)	+= physmap_of.o
 obj-$(CONFIG_MTD_PISMO)		+= pismo.o
 obj-$(CONFIG_MTD_PMC_MSP_EVM)   += pmcmsp-flash.o
diff --git a/drivers/mtd/maps/physmap_of_gemini.c b/drivers/mtd/maps/physmap_of_gemini.c
index 9d371cd728ea..616f162c4da1 100644
--- a/drivers/mtd/maps/physmap_of_gemini.c
+++ b/drivers/mtd/maps/physmap_of_gemini.c
@@ -6,6 +6,7 @@
  * detect and set it up when booting on this platform.
  */
 #include <linux/export.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/mtd/map.h>
@@ -115,3 +116,4 @@ int of_flash_probe_gemini(struct platform_device *pdev,
 
 	return 0;
 }
+EXPORT_SYMBOL(of_flash_probe_gemini);
diff --git a/drivers/mtd/maps/physmap_of_versatile.c b/drivers/mtd/maps/physmap_of_versatile.c
index 8c6ccded9be8..0583876bc053 100644
--- a/drivers/mtd/maps/physmap_of_versatile.c
+++ b/drivers/mtd/maps/physmap_of_versatile.c
@@ -21,6 +21,7 @@
  */
 #include <linux/export.h>
 #include <linux/io.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
@@ -252,3 +253,4 @@ int of_flash_probe_versatile(struct platform_device *pdev,
 
 	return 0;
 }
+EXPORT_SYMBOL(of_flash_probe_versatile);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] mtd: physmap_of: really fix the physmap add-ons
@ 2017-03-26 12:27 ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2017-03-26 12:27 UTC (permalink / raw)
  To: linux-arm-kernel

The current way of building the of_physmap add-ons result in just
the add-on being in the object code, and not the actual core
implementation and regress the Gemini and Versatile.

There is no way around exporting these functions. If they are
built as modules, they will become modules with exported functions,
if they are builtins they will become builtins.

Fixes: 4f04f68e1598 ("mtd: physmap_of: fixup gemini/versatile dependencies")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
The previous attempts to bake a single module from several *optional*
pieces doesn't play well with tristate, and if there is a way to
achieve that except making everything an #ifdef in the same file,
I sure haven't figured it out. I guess #include "physmap_addon.c"
directly into the C file would work but ugh that is ugly.
---
 drivers/mtd/maps/Makefile               | 8 ++------
 drivers/mtd/maps/physmap_of_gemini.c    | 2 ++
 drivers/mtd/maps/physmap_of_versatile.c | 2 ++
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile
index aef1846b4de2..608bdd37ac99 100644
--- a/drivers/mtd/maps/Makefile
+++ b/drivers/mtd/maps/Makefile
@@ -17,12 +17,8 @@ obj-$(CONFIG_MTD_CK804XROM)	+= ck804xrom.o
 obj-$(CONFIG_MTD_TSUNAMI)	+= tsunami_flash.o
 obj-$(CONFIG_MTD_PXA2XX)	+= pxa2xx-flash.o
 obj-$(CONFIG_MTD_PHYSMAP)	+= physmap.o
-ifdef CONFIG_MTD_PHYSMAP_OF_VERSATILE
-physmap_of-objs += physmap_of_versatile.o
-endif
-ifdef CONFIG_MTD_PHYSMAP_OF_GEMINI
-physmap_of-objs += physmap_of_gemini.o
-endif
+obj-$(CONFIG_MTD_PHYSMAP_OF_VERSATILE) += physmap_of_versatile.o
+obj-$(CONFIG_MTD_PHYSMAP_OF_GEMINI) += physmap_of_gemini.o
 obj-$(CONFIG_MTD_PHYSMAP_OF)	+= physmap_of.o
 obj-$(CONFIG_MTD_PISMO)		+= pismo.o
 obj-$(CONFIG_MTD_PMC_MSP_EVM)   += pmcmsp-flash.o
diff --git a/drivers/mtd/maps/physmap_of_gemini.c b/drivers/mtd/maps/physmap_of_gemini.c
index 9d371cd728ea..616f162c4da1 100644
--- a/drivers/mtd/maps/physmap_of_gemini.c
+++ b/drivers/mtd/maps/physmap_of_gemini.c
@@ -6,6 +6,7 @@
  * detect and set it up when booting on this platform.
  */
 #include <linux/export.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/mtd/map.h>
@@ -115,3 +116,4 @@ int of_flash_probe_gemini(struct platform_device *pdev,
 
 	return 0;
 }
+EXPORT_SYMBOL(of_flash_probe_gemini);
diff --git a/drivers/mtd/maps/physmap_of_versatile.c b/drivers/mtd/maps/physmap_of_versatile.c
index 8c6ccded9be8..0583876bc053 100644
--- a/drivers/mtd/maps/physmap_of_versatile.c
+++ b/drivers/mtd/maps/physmap_of_versatile.c
@@ -21,6 +21,7 @@
  */
 #include <linux/export.h>
 #include <linux/io.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
@@ -252,3 +253,4 @@ int of_flash_probe_versatile(struct platform_device *pdev,
 
 	return 0;
 }
+EXPORT_SYMBOL(of_flash_probe_versatile);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: physmap_of: really fix the physmap add-ons
  2017-03-26 12:27 ` Linus Walleij
@ 2017-03-27 13:54   ` Linus Walleij
  -1 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2017-03-27 13:54 UTC (permalink / raw)
  To: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, linux-mtd
  Cc: linux-arm-kernel, Linus Walleij

On Sun, Mar 26, 2017 at 2:27 PM, Linus Walleij <linus.walleij@linaro.org> wrote:

> The current way of building the of_physmap add-ons result in just
> the add-on being in the object code, and not the actual core
> implementation and regress the Gemini and Versatile.
>
> There is no way around exporting these functions. If they are
> built as modules, they will become modules with exported functions,
> if they are builtins they will become builtins.
>
> Fixes: 4f04f68e1598 ("mtd: physmap_of: fixup gemini/versatile dependencies")
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> The previous attempts to bake a single module from several *optional*
> pieces doesn't play well with tristate, and if there is a way to
> achieve that except making everything an #ifdef in the same file,
> I sure haven't figured it out. I guess #include "physmap_addon.c"
> directly into the C file would work but ugh that is ugly.

Bah, the build servers claim this doesn't work either.

OK investigating again, sigh. Kbuild always bites my ass.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] mtd: physmap_of: really fix the physmap add-ons
@ 2017-03-27 13:54   ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2017-03-27 13:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Mar 26, 2017 at 2:27 PM, Linus Walleij <linus.walleij@linaro.org> wrote:

> The current way of building the of_physmap add-ons result in just
> the add-on being in the object code, and not the actual core
> implementation and regress the Gemini and Versatile.
>
> There is no way around exporting these functions. If they are
> built as modules, they will become modules with exported functions,
> if they are builtins they will become builtins.
>
> Fixes: 4f04f68e1598 ("mtd: physmap_of: fixup gemini/versatile dependencies")
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> The previous attempts to bake a single module from several *optional*
> pieces doesn't play well with tristate, and if there is a way to
> achieve that except making everything an #ifdef in the same file,
> I sure haven't figured it out. I guess #include "physmap_addon.c"
> directly into the C file would work but ugh that is ugly.

Bah, the build servers claim this doesn't work either.

OK investigating again, sigh. Kbuild always bites my ass.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-27 13:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-26 12:27 [PATCH] mtd: physmap_of: really fix the physmap add-ons Linus Walleij
2017-03-26 12:27 ` Linus Walleij
2017-03-27 13:54 ` Linus Walleij
2017-03-27 13:54   ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.