All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] memory: omap-gpmc: Allow module build
@ 2022-04-26  8:26 Roger Quadros
  2022-04-26  8:26 ` [PATCH v4 1/2] memory: omap-gpmc: Make OMAP_GPMC config visible and selectable Roger Quadros
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Roger Quadros @ 2022-04-26  8:26 UTC (permalink / raw)
  To: krzk
  Cc: miquel.raynal, tony, vigneshr, kishon, nm, linux-omap,
	linux-kernel, Roger Quadros

Hi,

These patches allow OMAP_GPMC config to be visible in menuconfig
and buildable as a module.

cheers,
-roger

Changelog:
v4:
- drop COMPILE_TEST as include/linux/irqdomain.h does not have
fallbacks if CONFIG_IRQ_DOMAIN is not available. So build will
fail with COMPILE_TEST on platforms not having CONFIG_IRQ_DOMAIN.
- use GPL instead of GPL v2 for MODULE_LICENSE. Fixes checkpatch
warning.

v3:
- Remove not required MODULE_ALIAS
- Mention in commit message why we need to remove of_match_node() call

v2:
- Allow building as a module

Roger Quadros (2):
  memory: omap-gpmc: Make OMAP_GPMC config visible and selectable
  memory: omap-gpmc: Allow building as a module

 drivers/memory/Kconfig     |  2 +-
 drivers/memory/omap-gpmc.c | 43 ++++++++++++++++++++------------------
 2 files changed, 24 insertions(+), 21 deletions(-)

-- 
2.17.1


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

* [PATCH v4 1/2] memory: omap-gpmc: Make OMAP_GPMC config visible and selectable
  2022-04-26  8:26 [PATCH v4 0/2] memory: omap-gpmc: Allow module build Roger Quadros
@ 2022-04-26  8:26 ` Roger Quadros
  2022-04-26  8:26 ` [PATCH v4 2/2] memory: omap-gpmc: Allow building as a module Roger Quadros
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Roger Quadros @ 2022-04-26  8:26 UTC (permalink / raw)
  To: krzk
  Cc: miquel.raynal, tony, vigneshr, kishon, nm, linux-omap,
	linux-kernel, Roger Quadros

So far for armv7 TI platforms, GPMC was being selected by
arch/arm/mach-* architecture Kconfig files.

For K3 platforms, GPMC is no longer required for basic boot
and cannot be always enabled by default by mach- Kconfig.

We need a way for user (or board defconfig) to enable
it if required so make OMAP_GPMC Kconfig option always visible.

Drop COMPILE_TEST as build fails if IRQ_DOMAIN is not enabled.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
 drivers/memory/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
index 30bff6cb1b8d..da9634daad04 100644
--- a/drivers/memory/Kconfig
+++ b/drivers/memory/Kconfig
@@ -103,7 +103,7 @@ config TI_EMIF
 	  temperature changes
 
 config OMAP_GPMC
-	bool "Texas Instruments OMAP SoC GPMC driver" if COMPILE_TEST
+	bool "Texas Instruments OMAP SoC GPMC driver"
 	depends on OF_ADDRESS
 	select GPIOLIB
 	help
-- 
2.17.1


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

* [PATCH v4 2/2] memory: omap-gpmc: Allow building as a module
  2022-04-26  8:26 [PATCH v4 0/2] memory: omap-gpmc: Allow module build Roger Quadros
  2022-04-26  8:26 ` [PATCH v4 1/2] memory: omap-gpmc: Make OMAP_GPMC config visible and selectable Roger Quadros
@ 2022-04-26  8:26 ` Roger Quadros
  2022-04-29  6:59   ` Krzysztof Kozlowski
  2022-04-26  8:40 ` [PATCH v4 0/2] memory: omap-gpmc: Allow module build Roger Quadros
  2022-04-29  6:58 ` Krzysztof Kozlowski
  3 siblings, 1 reply; 6+ messages in thread
From: Roger Quadros @ 2022-04-26  8:26 UTC (permalink / raw)
  To: krzk
  Cc: miquel.raynal, tony, vigneshr, kishon, nm, linux-omap,
	linux-kernel, Roger Quadros

Allow OMAP_GPMC to be built as a module.

When building this driver as a module, the symbol
'of_default_bus_match_table' will not be found
as it is not being exported.

The of_match_node() call is redundant anyways as
of_platform_default_populate() already takes care of
matching with 'of_default_bus_match_table'. So get
rid of that call. This will also resolve the
module build failure.

Move compatible match table to the end where it is
usually expected.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
 drivers/memory/Kconfig     |  2 +-
 drivers/memory/omap-gpmc.c | 43 ++++++++++++++++++++------------------
 2 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
index da9634daad04..b7800b37af78 100644
--- a/drivers/memory/Kconfig
+++ b/drivers/memory/Kconfig
@@ -103,7 +103,7 @@ config TI_EMIF
 	  temperature changes
 
 config OMAP_GPMC
-	bool "Texas Instruments OMAP SoC GPMC driver"
+	tristate "Texas Instruments OMAP SoC GPMC driver"
 	depends on OF_ADDRESS
 	select GPIOLIB
 	help
diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index ed11887c1b7c..2351f2708da2 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -12,6 +12,7 @@
 #include <linux/cpu_pm.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/err.h>
 #include <linux/clk.h>
@@ -1889,16 +1890,6 @@ int gpmc_cs_program_settings(int cs, struct gpmc_settings *p)
 }
 
 #ifdef CONFIG_OF
-static const struct of_device_id gpmc_dt_ids[] = {
-	{ .compatible = "ti,omap2420-gpmc" },
-	{ .compatible = "ti,omap2430-gpmc" },
-	{ .compatible = "ti,omap3430-gpmc" },	/* omap3430 & omap3630 */
-	{ .compatible = "ti,omap4430-gpmc" },	/* omap4430 & omap4460 & omap543x */
-	{ .compatible = "ti,am3352-gpmc" },	/* am335x devices */
-	{ .compatible = "ti,am64-gpmc" },
-	{ }
-};
-
 static void gpmc_cs_set_name(int cs, const char *name)
 {
 	struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
@@ -2257,11 +2248,9 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
 	if (!of_platform_device_create(child, NULL, &pdev->dev))
 		goto err_child_fail;
 
-	/* is child a common bus? */
-	if (of_match_node(of_default_bus_match_table, child))
-		/* create children and other common bus children */
-		if (of_platform_default_populate(child, NULL, &pdev->dev))
-			goto err_child_fail;
+	/* create children and other common bus children */
+	if (of_platform_default_populate(child, NULL, &pdev->dev))
+		goto err_child_fail;
 
 	return 0;
 
@@ -2278,6 +2267,8 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
 	return ret;
 }
 
+static const struct of_device_id gpmc_dt_ids[];
+
 static int gpmc_probe_dt(struct platform_device *pdev)
 {
 	int ret;
@@ -2644,6 +2635,19 @@ static int gpmc_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(gpmc_pm_ops, gpmc_suspend, gpmc_resume);
 
+#ifdef CONFIG_OF
+static const struct of_device_id gpmc_dt_ids[] = {
+	{ .compatible = "ti,omap2420-gpmc" },
+	{ .compatible = "ti,omap2430-gpmc" },
+	{ .compatible = "ti,omap3430-gpmc" },	/* omap3430 & omap3630 */
+	{ .compatible = "ti,omap4430-gpmc" },	/* omap4430 & omap4460 & omap543x */
+	{ .compatible = "ti,am3352-gpmc" },	/* am335x devices */
+	{ .compatible = "ti,am64-gpmc" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, gpmc_dt_ids);
+#endif
+
 static struct platform_driver gpmc_driver = {
 	.probe		= gpmc_probe,
 	.remove		= gpmc_remove,
@@ -2654,8 +2658,7 @@ static struct platform_driver gpmc_driver = {
 	},
 };
 
-static __init int gpmc_init(void)
-{
-	return platform_driver_register(&gpmc_driver);
-}
-postcore_initcall(gpmc_init);
+module_platform_driver(gpmc_driver);
+
+MODULE_DESCRIPTION("Texas Instruments GPMC driver");
+MODULE_LICENSE("GPL");
-- 
2.17.1


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

* Re: [PATCH v4 0/2] memory: omap-gpmc: Allow module build
  2022-04-26  8:26 [PATCH v4 0/2] memory: omap-gpmc: Allow module build Roger Quadros
  2022-04-26  8:26 ` [PATCH v4 1/2] memory: omap-gpmc: Make OMAP_GPMC config visible and selectable Roger Quadros
  2022-04-26  8:26 ` [PATCH v4 2/2] memory: omap-gpmc: Allow building as a module Roger Quadros
@ 2022-04-26  8:40 ` Roger Quadros
  2022-04-29  6:58 ` Krzysztof Kozlowski
  3 siblings, 0 replies; 6+ messages in thread
From: Roger Quadros @ 2022-04-26  8:40 UTC (permalink / raw)
  To: krzk; +Cc: miquel.raynal, tony, vigneshr, kishon, nm, linux-omap,
	linux-kernel

Hi,

I've asked LKP bot to test my tree.
We should get a report if there are any surprises.

cheers,
-roger

On 26/04/2022 11:26, Roger Quadros wrote:
> Hi,
> 
> These patches allow OMAP_GPMC config to be visible in menuconfig
> and buildable as a module.
> 
> cheers,
> -roger
> 
> Changelog:
> v4:
> - drop COMPILE_TEST as include/linux/irqdomain.h does not have
> fallbacks if CONFIG_IRQ_DOMAIN is not available. So build will
> fail with COMPILE_TEST on platforms not having CONFIG_IRQ_DOMAIN.
> - use GPL instead of GPL v2 for MODULE_LICENSE. Fixes checkpatch
> warning.
> 
> v3:
> - Remove not required MODULE_ALIAS
> - Mention in commit message why we need to remove of_match_node() call
> 
> v2:
> - Allow building as a module
> 
> Roger Quadros (2):
>   memory: omap-gpmc: Make OMAP_GPMC config visible and selectable
>   memory: omap-gpmc: Allow building as a module
> 
>  drivers/memory/Kconfig     |  2 +-
>  drivers/memory/omap-gpmc.c | 43 ++++++++++++++++++++------------------
>  2 files changed, 24 insertions(+), 21 deletions(-)
> 

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

* Re: [PATCH v4 0/2] memory: omap-gpmc: Allow module build
  2022-04-26  8:26 [PATCH v4 0/2] memory: omap-gpmc: Allow module build Roger Quadros
                   ` (2 preceding siblings ...)
  2022-04-26  8:40 ` [PATCH v4 0/2] memory: omap-gpmc: Allow module build Roger Quadros
@ 2022-04-29  6:58 ` Krzysztof Kozlowski
  3 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-29  6:58 UTC (permalink / raw)
  To: Roger Quadros, krzk
  Cc: Krzysztof Kozlowski, linux-omap, linux-kernel, nm, tony, kishon,
	vigneshr, miquel.raynal

On Tue, 26 Apr 2022 11:26:09 +0300, Roger Quadros wrote:
> These patches allow OMAP_GPMC config to be visible in menuconfig
> and buildable as a module.
> 
> cheers,
> -roger
> 
> Changelog:
> v4:
> - drop COMPILE_TEST as include/linux/irqdomain.h does not have
> fallbacks if CONFIG_IRQ_DOMAIN is not available. So build will
> fail with COMPILE_TEST on platforms not having CONFIG_IRQ_DOMAIN.
> - use GPL instead of GPL v2 for MODULE_LICENSE. Fixes checkpatch
> warning.
> 
> [...]

Applied, thanks!

[1/2] memory: omap-gpmc: Make OMAP_GPMC config visible and selectable
      (no commit info)
[2/2] memory: omap-gpmc: Allow building as a module
      (no commit info)

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

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

* Re: [PATCH v4 2/2] memory: omap-gpmc: Allow building as a module
  2022-04-26  8:26 ` [PATCH v4 2/2] memory: omap-gpmc: Allow building as a module Roger Quadros
@ 2022-04-29  6:59   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-29  6:59 UTC (permalink / raw)
  To: Roger Quadros
  Cc: miquel.raynal, tony, vigneshr, kishon, nm, linux-omap,
	linux-kernel

On 26/04/2022 10:26, Roger Quadros wrote:
> Allow OMAP_GPMC to be built as a module.
> 
> When building this driver as a module, the symbol
> 'of_default_bus_match_table' will not be found
> as it is not being exported.
> 
> The of_match_node() call is redundant anyways as
> of_platform_default_populate() already takes care of
> matching with 'of_default_bus_match_table'. So get
> rid of that call. This will also resolve the
> module build failure.
> 
> Move compatible match table to the end where it is
> usually expected.

Don't
use
some
unusual
wrapping
style.

Read
instead:
https://elixir.bootlin.com/linux/v5.18-rc4/source/Documentation/process/submitting-patches.rst#L586


Best regards,
Krzysztof

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

end of thread, other threads:[~2022-04-29  6:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-26  8:26 [PATCH v4 0/2] memory: omap-gpmc: Allow module build Roger Quadros
2022-04-26  8:26 ` [PATCH v4 1/2] memory: omap-gpmc: Make OMAP_GPMC config visible and selectable Roger Quadros
2022-04-26  8:26 ` [PATCH v4 2/2] memory: omap-gpmc: Allow building as a module Roger Quadros
2022-04-29  6:59   ` Krzysztof Kozlowski
2022-04-26  8:40 ` [PATCH v4 0/2] memory: omap-gpmc: Allow module build Roger Quadros
2022-04-29  6:58 ` Krzysztof Kozlowski

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.