Skip to contentSkip to conversation

mtd: Remove gpio.h inclusions where we can

PATCH Applied Boris Brezillon 2 participants 8 messages Jul 20, 2018 – Jul 27, 2018

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover mtd: Remove gpio.h inclusions where we can

Hello,

The fix I sent here [1] lead me to look at other places including gpio.h in the MTD subsystem. While some inclusions are valid, some of them can be removed of replaced by gpio/consumer.h.

All these changes have been compile-tested.

Regards,

Boris

[1]http://patchwork.ozlabs.org/patch/946614/

Boris Brezillon (4):
mtd: rawnand: sunxi: Remove gpio.h and of_gpio.h inclusions
mtd: rawnand: atmel: Stop including gpio.h
mtd: rawnand: au1550nd: Remove unneeded gpio.h inclusion
mtd: spi-nor: atmel-qspi: Include gpio/consumer.h instead of gpio.h

 drivers/mtd/nand/raw/atmel/nand-controller.c | 1 -
 drivers/mtd/nand/raw/au1550nd.c              | 1 -
 drivers/mtd/nand/raw/sunxi_nand.c            | 2 --
 drivers/mtd/spi-nor/atmel-quadspi.c          | 2 +-
 4 files changed, 1 insertion(+), 5 deletions(-)
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/4 mtd: rawnand: sunxi: Remove gpio.h and of_gpio.h inclusions

Commit ddd5ed3a90e7 ("mtd: rawnand: sunxi: Remove support for GPIO-based Ready/Busy polling") removed GPIO-based RB polling. We no longer need to include gpio headers.

---
 drivers/mtd/nand/raw/sunxi_nand.c | 2 --
 1 file changed, 2 deletions(-)
drivers/mtd/nand/raw/sunxi_nand.c +0 -2
index 07f3ff9a28f2..2c0cbe72b449 100644
@@ -29,14 +29,12 @@
 #include <linux/platform_device.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
-#include <linux/of_gpio.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/rawnand.h>
 #include <linux/mtd/partitions.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/dmaengine.h>
-#include <linux/gpio.h>
 #include <linux/interrupt.h>
 #include <linux/iopoll.h>
 #include <linux/reset.h>
Signature · 1 line
2.14.1
#2 lore raw

PATCH 2/4 mtd: rawnand: atmel: Stop including gpio.h

In reply to Boris Brezillon

gpio/consumer.h defines everything we need, and it's clearly stated in gpio.h that GPIO consumers should directly stop including gpio.h if they can.

---
 drivers/mtd/nand/raw/atmel/nand-controller.c | 1 -
 1 file changed, 1 deletion(-)
drivers/mtd/nand/raw/atmel/nand-controller.c +0 -1
index 855cc7729c43..4d27401f1299 100644
@@ -52,7 +52,6 @@
 #include <linux/dma-mapping.h>
 #include <linux/dmaengine.h>
 #include <linux/genalloc.h>
-#include <linux/gpio.h>
 #include <linux/gpio/consumer.h>
 #include <linux/interrupt.h>
 #include <linux/mfd/syscon.h>
Signature · 1 line
2.14.1
#3 lore raw

PATCH 3/4 mtd: rawnand: au1550nd: Remove unneeded gpio.h inclusion

In reply to Boris Brezillon

We don't use the GPIO API in this driver, let's just remove the <linux/gpio.h> inclusion.

---
 drivers/mtd/nand/raw/au1550nd.c | 1 -
 1 file changed, 1 deletion(-)
drivers/mtd/nand/raw/au1550nd.c +0 -1
index df0ef1f1e2f5..35f5c84cd331 100644
@@ -8,7 +8,6 @@
  */
 
 #include <linux/slab.h>
-#include <linux/gpio.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/mtd/mtd.h>
Signature · 1 line
2.14.1
#4 lore raw

PATCH 4/4 mtd: spi-nor: atmel-qspi: Include gpio/consumer.h instead of gpio.h

In reply to Boris Brezillon

GPIO consumers now include <linux/gpio/consumer.h> instead of <linux/gpio.h> if they can.

---
 drivers/mtd/spi-nor/atmel-quadspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/atmel-quadspi.c +1 -1
index 6c5708bacad8..ce65c2b53ac1 100644
@@ -34,7 +34,7 @@
 #include <linux/of.h>
 
 #include <linux/io.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 
 /* QSPI register offsets */
 #define QSPI_CR      0x0000  /* Control Register */
Signature · 1 line
2.14.1
author Applied
#5 lore raw

Re: [PATCH 4/4] mtd: spi-nor: atmel-qspi: Include gpio/consumer.h instead of gpio.h

Quoted 4 lines · On Fri, 20 Jul 2018 11:57:41 +0200 Boris Brezillon…

GPIO consumers now include <linux/gpio/consumer.h> instead of <linux/gpio.h> if they can.

Applied.

Quoted 17 lines
---
 drivers/mtd/spi-nor/atmel-quadspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/atmel-quadspi.c +1 -1
index 6c5708bacad8..ce65c2b53ac1 100644
@@ -34,7 +34,7 @@
 #include <linux/of.h>
 
 #include <linux/io.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 
 /* QSPI register offsets */
 #define QSPI_CR      0x0000  /* Control Register */
maintainer
#6 lore raw
In reply to Boris Brezillon

Hi Boris,

Boris Brezillon <[email protected]> wrote on Fri, 20 Jul 2018 11:57:37 +0200:

Quoted 20 lines

Hello,

The fix I sent here [1] lead me to look at other places including gpio.h in the MTD subsystem. While some inclusions are valid, some of them can be removed of replaced by gpio/consumer.h.

All these changes have been compile-tested.

Regards,

Boris

[1]http://patchwork.ozlabs.org/patch/946614/

Boris Brezillon (4):
mtd: rawnand: sunxi: Remove gpio.h and of_gpio.h inclusions
mtd: rawnand: atmel: Stop including gpio.h
mtd: rawnand: au1550nd: Remove unneeded gpio.h inclusion
mtd: spi-nor: atmel-qspi: Include gpio/consumer.h instead of gpio.h

Quoted 6 lines
 drivers/mtd/nand/raw/atmel/nand-controller.c | 1 -
 drivers/mtd/nand/raw/au1550nd.c              | 1 -
 drivers/mtd/nand/raw/sunxi_nand.c            | 2 --
 drivers/mtd/spi-nor/atmel-quadspi.c          | 2 +-
 4 files changed, 1 insertion(+), 5 deletions(-)

Series applied to nand/next.

Thanks,
Miquèl

maintainer
#7 lore raw

Hi Miquel,

Miquel Raynal <[email protected]> wrote on Fri, 27 Jul 2018 01:29:15 +0200:

Quoted 25 lines

Hi Boris,

Boris Brezillon <[email protected]> wrote on Fri, 20 Jul 2018 11:57:37 +0200:

Quoted 20 lines

Hello,

The fix I sent here [1] lead me to look at other places including gpio.h in the MTD subsystem. While some inclusions are valid, some of them can be removed of replaced by gpio/consumer.h.

All these changes have been compile-tested.

Regards,

Boris

[1]http://patchwork.ozlabs.org/patch/946614/

Boris Brezillon (4):
mtd: rawnand: sunxi: Remove gpio.h and of_gpio.h inclusions
mtd: rawnand: atmel: Stop including gpio.h
mtd: rawnand: au1550nd: Remove unneeded gpio.h inclusion
mtd: spi-nor: atmel-qspi: Include gpio/consumer.h instead of gpio.h

Quoted 8 lines
Quoted 6 lines
 drivers/mtd/nand/raw/atmel/nand-controller.c | 1 -
 drivers/mtd/nand/raw/au1550nd.c              | 1 -
 drivers/mtd/nand/raw/sunxi_nand.c            | 2 --
 drivers/mtd/spi-nor/atmel-quadspi.c          | 2 +-
 4 files changed, 1 insertion(+), 5 deletions(-)

Series applied to nand/next.

Of course I was speaking about patches 1,2,3 only.

Quoted 3 lines

Thanks,
Miquèl

Signature · 3 lines
Miquel Raynal, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com