public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mfd: rsmu: fix mixed module-builtin object
@ 2023-06-04  4:25 Masahiro Yamada
  2023-06-04  4:25 ` [PATCH 2/2] mfd: rsmu: turn rsmu-{core,i2c,spi} into single-object modules Masahiro Yamada
  0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2023-06-04  4:25 UTC (permalink / raw)
  To: linux-kernel, Lee Jones; +Cc: Masahiro Yamada, Nick Terrell

With CONFIG_MFD_RSMU_I2C=m and CONFIG_MFD_RSMU_SPI=y (or vice versa),
rsmu_core.o is linked to a module and also to vmlinux even though the
expected CFLAGS are different between builtins and modules.

This is the same situation as fixed by commit 637a642f5ca5 ("zstd:
Fixing mixed module-builtin objects").

Split rsmu-core into a separate module.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 drivers/mfd/Kconfig     | 8 ++++++--
 drivers/mfd/Makefile    | 6 ++++--
 drivers/mfd/rsmu_core.c | 3 +++
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index e90463c4441c..1b2eeb654e91 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -2215,10 +2215,14 @@ config MFD_INTEL_M10_BMC_PMCI
 	  additional drivers must be enabled in order to use the functionality
 	  of the device.
 
+config MFD_RSMU_CORE
+	tristate
+	select MFD_CORE
+
 config MFD_RSMU_I2C
 	tristate "Renesas Synchronization Management Unit with I2C"
 	depends on I2C && OF
-	select MFD_CORE
+	select MFD_RSMU_CORE
 	select REGMAP_I2C
 	help
 	  Support for the Renesas Synchronization Management Unit, such as
@@ -2232,7 +2236,7 @@ config MFD_RSMU_I2C
 config MFD_RSMU_SPI
 	tristate "Renesas Synchronization Management Unit with SPI"
 	depends on SPI && OF
-	select MFD_CORE
+	select MFD_RSMU_CORE
 	select REGMAP_SPI
 	help
 	  Support for the Renesas Synchronization Management Unit, such as
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 1d2392f06f78..2a0e80f941a1 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -271,7 +271,9 @@ obj-$(CONFIG_MFD_INTEL_M10_BMC_PMCI)   += intel-m10-bmc-pmci.o
 obj-$(CONFIG_MFD_ATC260X)	+= atc260x-core.o
 obj-$(CONFIG_MFD_ATC260X_I2C)	+= atc260x-i2c.o
 
-rsmu-i2c-objs			:= rsmu_core.o rsmu_i2c.o
-rsmu-spi-objs			:= rsmu_core.o rsmu_spi.o
+rsmu-core-objs			:= rsmu_core.o
+rsmu-i2c-objs			:= rsmu_i2c.o
+rsmu-spi-objs			:= rsmu_spi.o
+obj-$(CONFIG_MFD_RSMU_CORE)	+= rsmu-core.o
 obj-$(CONFIG_MFD_RSMU_I2C)	+= rsmu-i2c.o
 obj-$(CONFIG_MFD_RSMU_SPI)	+= rsmu-spi.o
diff --git a/drivers/mfd/rsmu_core.c b/drivers/mfd/rsmu_core.c
index 29437fd0bd5b..5bf1e23a47e5 100644
--- a/drivers/mfd/rsmu_core.c
+++ b/drivers/mfd/rsmu_core.c
@@ -5,6 +5,7 @@
  * Copyright (C) 2021 Integrated Device Technology, Inc., a Renesas Company.
  */
 
+#include <linux/export.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/mfd/core.h>
@@ -78,11 +79,13 @@ int rsmu_core_init(struct rsmu_ddata *rsmu)
 
 	return ret;
 }
+EXPORT_SYMBOL_GPL(rsmu_core_init);
 
 void rsmu_core_exit(struct rsmu_ddata *rsmu)
 {
 	mutex_destroy(&rsmu->lock);
 }
+EXPORT_SYMBOL_GPL(rsmu_core_exit);
 
 MODULE_DESCRIPTION("Renesas SMU core driver");
 MODULE_LICENSE("GPL");
-- 
2.39.2


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

* [PATCH 2/2] mfd: rsmu: turn rsmu-{core,i2c,spi} into single-object modules
  2023-06-04  4:25 [PATCH 1/2] mfd: rsmu: fix mixed module-builtin object Masahiro Yamada
@ 2023-06-04  4:25 ` Masahiro Yamada
  2023-06-15 14:00   ` Lee Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2023-06-04  4:25 UTC (permalink / raw)
  To: linux-kernel, Lee Jones; +Cc: Masahiro Yamada

With the previous fix, these modules are built from a single C file.

Rename the source files so they match the module names.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 drivers/mfd/Makefile                     | 3 ---
 drivers/mfd/{rsmu_core.c => rsmu-core.c} | 0
 drivers/mfd/{rsmu_i2c.c => rsmu-i2c.c}   | 0
 drivers/mfd/{rsmu_spi.c => rsmu-spi.c}   | 0
 4 files changed, 3 deletions(-)
 rename drivers/mfd/{rsmu_core.c => rsmu-core.c} (100%)
 rename drivers/mfd/{rsmu_i2c.c => rsmu-i2c.c} (100%)
 rename drivers/mfd/{rsmu_spi.c => rsmu-spi.c} (100%)

diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 2a0e80f941a1..0fe213858974 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -271,9 +271,6 @@ obj-$(CONFIG_MFD_INTEL_M10_BMC_PMCI)   += intel-m10-bmc-pmci.o
 obj-$(CONFIG_MFD_ATC260X)	+= atc260x-core.o
 obj-$(CONFIG_MFD_ATC260X_I2C)	+= atc260x-i2c.o
 
-rsmu-core-objs			:= rsmu_core.o
-rsmu-i2c-objs			:= rsmu_i2c.o
-rsmu-spi-objs			:= rsmu_spi.o
 obj-$(CONFIG_MFD_RSMU_CORE)	+= rsmu-core.o
 obj-$(CONFIG_MFD_RSMU_I2C)	+= rsmu-i2c.o
 obj-$(CONFIG_MFD_RSMU_SPI)	+= rsmu-spi.o
diff --git a/drivers/mfd/rsmu_core.c b/drivers/mfd/rsmu-core.c
similarity index 100%
rename from drivers/mfd/rsmu_core.c
rename to drivers/mfd/rsmu-core.c
diff --git a/drivers/mfd/rsmu_i2c.c b/drivers/mfd/rsmu-i2c.c
similarity index 100%
rename from drivers/mfd/rsmu_i2c.c
rename to drivers/mfd/rsmu-i2c.c
diff --git a/drivers/mfd/rsmu_spi.c b/drivers/mfd/rsmu-spi.c
similarity index 100%
rename from drivers/mfd/rsmu_spi.c
rename to drivers/mfd/rsmu-spi.c
-- 
2.39.2


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

* Re: [PATCH 2/2] mfd: rsmu: turn rsmu-{core,i2c,spi} into single-object modules
  2023-06-04  4:25 ` [PATCH 2/2] mfd: rsmu: turn rsmu-{core,i2c,spi} into single-object modules Masahiro Yamada
@ 2023-06-15 14:00   ` Lee Jones
  2023-06-16  5:03     ` Masahiro Yamada
  0 siblings, 1 reply; 5+ messages in thread
From: Lee Jones @ 2023-06-15 14:00 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-kernel

On Sun, 04 Jun 2023, Masahiro Yamada wrote:

> With the previous fix, these modules are built from a single C file.
> 
> Rename the source files so they match the module names.

Should this be part of the previous patch?

> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  drivers/mfd/Makefile                     | 3 ---
>  drivers/mfd/{rsmu_core.c => rsmu-core.c} | 0
>  drivers/mfd/{rsmu_i2c.c => rsmu-i2c.c}   | 0
>  drivers/mfd/{rsmu_spi.c => rsmu-spi.c}   | 0
>  4 files changed, 3 deletions(-)
>  rename drivers/mfd/{rsmu_core.c => rsmu-core.c} (100%)
>  rename drivers/mfd/{rsmu_i2c.c => rsmu-i2c.c} (100%)
>  rename drivers/mfd/{rsmu_spi.c => rsmu-spi.c} (100%)
> 
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index 2a0e80f941a1..0fe213858974 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -271,9 +271,6 @@ obj-$(CONFIG_MFD_INTEL_M10_BMC_PMCI)   += intel-m10-bmc-pmci.o
>  obj-$(CONFIG_MFD_ATC260X)	+= atc260x-core.o
>  obj-$(CONFIG_MFD_ATC260X_I2C)	+= atc260x-i2c.o
>  
> -rsmu-core-objs			:= rsmu_core.o
> -rsmu-i2c-objs			:= rsmu_i2c.o
> -rsmu-spi-objs			:= rsmu_spi.o
>  obj-$(CONFIG_MFD_RSMU_CORE)	+= rsmu-core.o
>  obj-$(CONFIG_MFD_RSMU_I2C)	+= rsmu-i2c.o
>  obj-$(CONFIG_MFD_RSMU_SPI)	+= rsmu-spi.o
> diff --git a/drivers/mfd/rsmu_core.c b/drivers/mfd/rsmu-core.c
> similarity index 100%
> rename from drivers/mfd/rsmu_core.c
> rename to drivers/mfd/rsmu-core.c
> diff --git a/drivers/mfd/rsmu_i2c.c b/drivers/mfd/rsmu-i2c.c
> similarity index 100%
> rename from drivers/mfd/rsmu_i2c.c
> rename to drivers/mfd/rsmu-i2c.c
> diff --git a/drivers/mfd/rsmu_spi.c b/drivers/mfd/rsmu-spi.c
> similarity index 100%
> rename from drivers/mfd/rsmu_spi.c
> rename to drivers/mfd/rsmu-spi.c
> -- 
> 2.39.2
> 

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH 2/2] mfd: rsmu: turn rsmu-{core,i2c,spi} into single-object modules
  2023-06-15 14:00   ` Lee Jones
@ 2023-06-16  5:03     ` Masahiro Yamada
  2023-06-19  8:33       ` Lee Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2023-06-16  5:03 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel

On Thu, Jun 15, 2023 at 11:00 PM Lee Jones <lee@kernel.org> wrote:
>
> On Sun, 04 Jun 2023, Masahiro Yamada wrote:
>
> > With the previous fix, these modules are built from a single C file.
> >
> > Rename the source files so they match the module names.
>
> Should this be part of the previous patch?


I do not know. It is up to the maintainer's preference (you).

If you want me to send a squashed patch, I will be
happy to do so.


Masahiro






-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH 2/2] mfd: rsmu: turn rsmu-{core,i2c,spi} into single-object modules
  2023-06-16  5:03     ` Masahiro Yamada
@ 2023-06-19  8:33       ` Lee Jones
  0 siblings, 0 replies; 5+ messages in thread
From: Lee Jones @ 2023-06-19  8:33 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-kernel

On Fri, 16 Jun 2023, Masahiro Yamada wrote:

> On Thu, Jun 15, 2023 at 11:00 PM Lee Jones <lee@kernel.org> wrote:
> >
> > On Sun, 04 Jun 2023, Masahiro Yamada wrote:
> >
> > > With the previous fix, these modules are built from a single C file.
> > >
> > > Rename the source files so they match the module names.
> >
> > Should this be part of the previous patch?
> 
> 
> I do not know. It is up to the maintainer's preference (you).
> 
> If you want me to send a squashed patch, I will be
> happy to do so.

I think it makes sense in this case.

-- 
Lee Jones [李琼斯]

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

end of thread, other threads:[~2023-06-19  8:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-04  4:25 [PATCH 1/2] mfd: rsmu: fix mixed module-builtin object Masahiro Yamada
2023-06-04  4:25 ` [PATCH 2/2] mfd: rsmu: turn rsmu-{core,i2c,spi} into single-object modules Masahiro Yamada
2023-06-15 14:00   ` Lee Jones
2023-06-16  5:03     ` Masahiro Yamada
2023-06-19  8:33       ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox