public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/3] mtd: spi-nor: headers cleanup
@ 2025-03-07  7:09 Tudor Ambarus
  2025-03-07  7:09 ` [PATCH 1/3] mtd: spi-nor: explicitly include <linux/of.h> Tudor Ambarus
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Tudor Ambarus @ 2025-03-07  7:09 UTC (permalink / raw)
  To: Pratyush Yadav, Michael Walle, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra
  Cc: linux-mtd, linux-kernel, Tudor Ambarus

A bunch of header cleanups, no dependencies.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
Tudor Ambarus (3):
      mtd: spi-nor: explicitly include <linux/of.h>
      mtd: spi-nor: explicitly include <linux/mod_devicetable.h>
      mtd: spi-nor: drop unused <linux/of_platform.h>

 drivers/mtd/spi-nor/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
base-commit: 93020292fea71d62dc9749745d8ba1b44268a2fc
change-id: 20250307-spi-nor-headers-cleanup-e93740995eb0

Best regards,
-- 
Tudor Ambarus <tudor.ambarus@linaro.org>


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* [PATCH 1/3] mtd: spi-nor: explicitly include <linux/of.h>
  2025-03-07  7:09 [PATCH 0/3] mtd: spi-nor: headers cleanup Tudor Ambarus
@ 2025-03-07  7:09 ` Tudor Ambarus
  2025-03-07  8:15   ` Miquel Raynal
  2025-03-07  7:09 ` [PATCH 2/3] mtd: spi-nor: explicitly include <linux/mod_devicetable.h> Tudor Ambarus
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Tudor Ambarus @ 2025-03-07  7:09 UTC (permalink / raw)
  To: Pratyush Yadav, Michael Walle, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra
  Cc: linux-mtd, linux-kernel, Tudor Ambarus

The core driver is using of_property_read_bool() and relies on implicit
inclusion of <linux/of.h>, which comes from <linux/mtd/mtd.h>.

It is good practice to directly include all headers used, it avoids
implicit dependencies and spurious breakage if someone rearranges
headers and causes the implicit include to vanish.

Include the missing header.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 drivers/mtd/spi-nor/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index c9b970f35c6b23a962011ee3c543ee9f4df711d5..1091c83294fa33393f27f914efb254da7a7524a2 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -17,6 +17,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/spi-nor.h>
 #include <linux/mutex.h>
+#include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/regulator/consumer.h>
 #include <linux/sched/task_stack.h>

-- 
2.34.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* [PATCH 2/3] mtd: spi-nor: explicitly include <linux/mod_devicetable.h>
  2025-03-07  7:09 [PATCH 0/3] mtd: spi-nor: headers cleanup Tudor Ambarus
  2025-03-07  7:09 ` [PATCH 1/3] mtd: spi-nor: explicitly include <linux/of.h> Tudor Ambarus
@ 2025-03-07  7:09 ` Tudor Ambarus
  2025-03-07  8:22   ` Miquel Raynal
  2025-03-07  7:09 ` [PATCH 3/3] mtd: spi-nor: drop unused <linux/of_platform.h> Tudor Ambarus
  2025-03-18  6:04 ` (subset)Re: [PATCH 0/3] mtd: spi-nor: headers cleanup Tudor Ambarus
  3 siblings, 1 reply; 9+ messages in thread
From: Tudor Ambarus @ 2025-03-07  7:09 UTC (permalink / raw)
  To: Pratyush Yadav, Michael Walle, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra
  Cc: linux-mtd, linux-kernel, Tudor Ambarus

The core driver is using 'struct of_device_id' and relies on implicit
inclusion of <linux/mod_devicetable.h>, which comes from
<linux/of_platform.h>.

It is good practice to directly include all headers used, it avoids
implicit dependencies and spurious breakage if someone rearranges
headers and causes the implicit include to vanish.

Include the missing header.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 drivers/mtd/spi-nor/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index 1091c83294fa33393f27f914efb254da7a7524a2..ec298a285f820383b2c1d9ef4462a000d1b3b861 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -13,6 +13,7 @@
 #include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/math64.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/spi-nor.h>

-- 
2.34.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* [PATCH 3/3] mtd: spi-nor: drop unused <linux/of_platform.h>
  2025-03-07  7:09 [PATCH 0/3] mtd: spi-nor: headers cleanup Tudor Ambarus
  2025-03-07  7:09 ` [PATCH 1/3] mtd: spi-nor: explicitly include <linux/of.h> Tudor Ambarus
  2025-03-07  7:09 ` [PATCH 2/3] mtd: spi-nor: explicitly include <linux/mod_devicetable.h> Tudor Ambarus
@ 2025-03-07  7:09 ` Tudor Ambarus
  2025-03-07  8:23   ` Miquel Raynal
  2025-03-18  6:04 ` (subset)Re: [PATCH 0/3] mtd: spi-nor: headers cleanup Tudor Ambarus
  3 siblings, 1 reply; 9+ messages in thread
From: Tudor Ambarus @ 2025-03-07  7:09 UTC (permalink / raw)
  To: Pratyush Yadav, Michael Walle, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra
  Cc: linux-mtd, linux-kernel, Tudor Ambarus

There's nothing used in the SPI NOR core from <linux/of_platform.h>,
drop the header inclusion.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 drivers/mtd/spi-nor/core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index ec298a285f820383b2c1d9ef4462a000d1b3b861..deb284e95dbe37fee275fd6bbfcb3ae04e163edc 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -19,7 +19,6 @@
 #include <linux/mtd/spi-nor.h>
 #include <linux/mutex.h>
 #include <linux/of.h>
-#include <linux/of_platform.h>
 #include <linux/regulator/consumer.h>
 #include <linux/sched/task_stack.h>
 #include <linux/sizes.h>

-- 
2.34.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 1/3] mtd: spi-nor: explicitly include <linux/of.h>
  2025-03-07  7:09 ` [PATCH 1/3] mtd: spi-nor: explicitly include <linux/of.h> Tudor Ambarus
@ 2025-03-07  8:15   ` Miquel Raynal
  0 siblings, 0 replies; 9+ messages in thread
From: Miquel Raynal @ 2025-03-07  8:15 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: Pratyush Yadav, Michael Walle, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd, linux-kernel

On 07/03/2025 at 09:09:05 +02, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:

> The core driver is using of_property_read_bool() and relies on implicit
> inclusion of <linux/of.h>, which comes from <linux/mtd/mtd.h>.
>
> It is good practice to directly include all headers used, it avoids
> implicit dependencies and spurious breakage if someone rearranges
> headers and causes the implicit include to vanish.
>
> Include the missing header.
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 2/3] mtd: spi-nor: explicitly include <linux/mod_devicetable.h>
  2025-03-07  7:09 ` [PATCH 2/3] mtd: spi-nor: explicitly include <linux/mod_devicetable.h> Tudor Ambarus
@ 2025-03-07  8:22   ` Miquel Raynal
  2025-03-07 12:21     ` Tudor Ambarus
  0 siblings, 1 reply; 9+ messages in thread
From: Miquel Raynal @ 2025-03-07  8:22 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: Pratyush Yadav, Michael Walle, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd, linux-kernel

Hello Tudor,

On 07/03/2025 at 09:09:06 +02, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:

> The core driver is using 'struct of_device_id' and relies on implicit
> inclusion of <linux/mod_devicetable.h>, which comes from
> <linux/of_platform.h>.

It is actually included from of.h now (since patch 1) and I wonder
whether there is a need for it to be included explicitly. As a user it
feels like "of.h" should already include whatever is needed for us (and
it's the case). Looking at the numbers, about 25% of the drivers do
include it explicitly. But either ways I'm fine.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 3/3] mtd: spi-nor: drop unused <linux/of_platform.h>
  2025-03-07  7:09 ` [PATCH 3/3] mtd: spi-nor: drop unused <linux/of_platform.h> Tudor Ambarus
@ 2025-03-07  8:23   ` Miquel Raynal
  0 siblings, 0 replies; 9+ messages in thread
From: Miquel Raynal @ 2025-03-07  8:23 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: Pratyush Yadav, Michael Walle, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd, linux-kernel

On 07/03/2025 at 09:09:07 +02, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:

> There's nothing used in the SPI NOR core from <linux/of_platform.h>,
> drop the header inclusion.
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH 2/3] mtd: spi-nor: explicitly include <linux/mod_devicetable.h>
  2025-03-07  8:22   ` Miquel Raynal
@ 2025-03-07 12:21     ` Tudor Ambarus
  0 siblings, 0 replies; 9+ messages in thread
From: Tudor Ambarus @ 2025-03-07 12:21 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Pratyush Yadav, Michael Walle, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd, linux-kernel



On 3/7/25 8:22 AM, Miquel Raynal wrote:
> Hello Tudor,

Hi, Miquel!
> 
> On 07/03/2025 at 09:09:06 +02, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:
> 
>> The core driver is using 'struct of_device_id' and relies on implicit
>> inclusion of <linux/mod_devicetable.h>, which comes from
>> <linux/of_platform.h>.
> 
> It is actually included from of.h now (since patch 1) and I wonder
> whether there is a need for it to be included explicitly. As a user it
> feels like "of.h" should already include whatever is needed for us (and

Seems so. I'll drop this patch. Thanks!
ta

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* (subset)Re: [PATCH 0/3] mtd: spi-nor: headers cleanup
  2025-03-07  7:09 [PATCH 0/3] mtd: spi-nor: headers cleanup Tudor Ambarus
                   ` (2 preceding siblings ...)
  2025-03-07  7:09 ` [PATCH 3/3] mtd: spi-nor: drop unused <linux/of_platform.h> Tudor Ambarus
@ 2025-03-18  6:04 ` Tudor Ambarus
  3 siblings, 0 replies; 9+ messages in thread
From: Tudor Ambarus @ 2025-03-18  6:04 UTC (permalink / raw)
  To: Pratyush Yadav, Michael Walle, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Tudor Ambarus
  Cc: linux-mtd, linux-kernel


On Fri, 07 Mar 2025 09:09:04 +0200, Tudor Ambarus wrote:
> A bunch of header cleanups, no dependencies.
> 
> 

Subset applied, thanks!

[1/3] mtd: spi-nor: explicitly include <linux/of.h>
      https://git.kernel.org/mtd/c/fafa240a1798
[3/3] mtd: spi-nor: drop unused <linux/of_platform.h>
      https://git.kernel.org/mtd/c/eec373688d91

Best regards,
-- 
Tudor Ambarus <tudor.ambarus@linaro.org>

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2025-03-18  6:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-07  7:09 [PATCH 0/3] mtd: spi-nor: headers cleanup Tudor Ambarus
2025-03-07  7:09 ` [PATCH 1/3] mtd: spi-nor: explicitly include <linux/of.h> Tudor Ambarus
2025-03-07  8:15   ` Miquel Raynal
2025-03-07  7:09 ` [PATCH 2/3] mtd: spi-nor: explicitly include <linux/mod_devicetable.h> Tudor Ambarus
2025-03-07  8:22   ` Miquel Raynal
2025-03-07 12:21     ` Tudor Ambarus
2025-03-07  7:09 ` [PATCH 3/3] mtd: spi-nor: drop unused <linux/of_platform.h> Tudor Ambarus
2025-03-07  8:23   ` Miquel Raynal
2025-03-18  6:04 ` (subset)Re: [PATCH 0/3] mtd: spi-nor: headers cleanup Tudor Ambarus

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