Skip to contentSkip to conversation

mtd: rawnand: lpc32xx: Remove platform data support from drivers

PATCH Applied Vladimir Zapolskiy 2 participants 7 messages Sep 3 – Sep 4

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

cover mtd: rawnand: lpc32xx: Remove platform data support from drivers

Since NXP LPC32xx SoC support in the Linux kernel strictly depends on device tree support, the unused platform data support can be removed from the LPC32xx NAND MLC and SLC drivers.

Vladimir Zapolskiy (2):
mtd: rawnand: lpc32xx_slc: Remove platform data support
mtd: rawnand: lpc32xx_mlc: Remove platform data support

 drivers/mtd/nand/raw/lpc32xx_mlc.c | 21 ++-------------------
 drivers/mtd/nand/raw/lpc32xx_slc.c | 21 ++-------------------
 include/linux/mtd/lpc32xx_mlc.h    | 17 -----------------
 include/linux/mtd/lpc32xx_slc.h    | 17 -----------------
 4 files changed, 4 insertions(+), 72 deletions(-)
 delete mode 100644 include/linux/mtd/lpc32xx_mlc.h
 delete mode 100644 include/linux/mtd/lpc32xx_slc.h
Signature · 6 lines
2.51.0


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

PATCH 1/2 mtd: rawnand: lpc32xx_slc: Remove platform data support

Since NXP LPC32xx SoC support in the Linux kernel strictly depends on device tree support, the unused platform data support can be removed from the NAND SLC driver.

---
 drivers/mtd/nand/raw/lpc32xx_slc.c | 21 ++-------------------
 include/linux/mtd/lpc32xx_slc.h    | 17 -----------------
 2 files changed, 2 insertions(+), 36 deletions(-)
 delete mode 100644 include/linux/mtd/lpc32xx_slc.h
drivers/mtd/nand/raw/lpc32xx_slc.c +2 -19
index 10c8080207f4..b4d90afa9267 100644
@@ -25,7 +25,6 @@
 #include <linux/dmaengine.h>
 #include <linux/gpio/consumer.h>
 #include <linux/of.h>
-#include <linux/mtd/lpc32xx_slc.h>
 
 #define LPC32XX_MODNAME		"lpc32xx-nand"
 
@@ -213,7 +212,6 @@ struct lpc32xx_nand_cfg_slc {
 
 struct lpc32xx_nand_host {
 	struct nand_chip	nand_chip;
-	struct lpc32xx_slc_platform_data *pdata;
 	struct clk		*clk;
 	struct gpio_desc	*wp_gpio;
 	void __iomem		*io_base;
@@ -727,24 +725,11 @@ static int lpc32xx_nand_write_page_raw_syndrome(struct nand_chip *chip,
 static int lpc32xx_nand_dma_setup(struct lpc32xx_nand_host *host)
 {
 	struct mtd_info *mtd = nand_to_mtd(&host->nand_chip);
-	dma_cap_mask_t mask;
 
 	host->dma_chan = dma_request_chan(mtd->dev.parent, "rx-tx");
 	if (IS_ERR(host->dma_chan)) {
-		/* fallback to request using platform data */
-		if (!host->pdata || !host->pdata->dma_filter) {
-			dev_err(mtd->dev.parent, "no DMA platform data\n");
-			return -ENOENT;
-		}
-
-		dma_cap_zero(mask);
-		dma_cap_set(DMA_SLAVE, mask);
-		host->dma_chan = dma_request_channel(mask, host->pdata->dma_filter, "nand-slc");
-
-		if (!host->dma_chan) {
-			dev_err(mtd->dev.parent, "Failed to request DMA channel\n");
-			return -EBUSY;
-		}
+		dev_err(mtd->dev.parent, "Failed to request DMA channel\n");
+		return PTR_ERR(host->dma_chan);
 	}
 
 	return 0;
@@ -873,8 +858,6 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
 
 	gpiod_set_consumer_name(host->wp_gpio, "NAND WP");
 
-	host->pdata = dev_get_platdata(&pdev->dev);
-
 	chip = &host->nand_chip;
 	mtd = nand_to_mtd(chip);
 	nand_set_controller_data(chip, host);
include/linux/mtd/lpc32xx_slc.h deleted +0 -17
deleted file mode 100644
index a044b806566b..000000000000
@@ -1,17 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Platform data for LPC32xx SoC SLC NAND controller
- *
- * Copyright © 2012 Roland Stigge
- */
-
-#ifndef __LINUX_MTD_LPC32XX_SLC_H
-#define __LINUX_MTD_LPC32XX_SLC_H
-
-#include <linux/dmaengine.h>
-
-struct lpc32xx_slc_platform_data {
-	dma_filter_fn dma_filter;
-};
-
-#endif  /* __LINUX_MTD_LPC32XX_SLC_H */
Signature · 6 lines
2.51.0


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

PATCH 2/2 mtd: rawnand: lpc32xx_mlc: Remove platform data support

In reply to Vladimir Zapolskiy

Since NXP LPC32xx SoC support in the Linux kernel strictly depends on device tree support, the unused platform data support can be removed from the NAND MLC driver.

---
 drivers/mtd/nand/raw/lpc32xx_mlc.c | 21 ++-------------------
 include/linux/mtd/lpc32xx_mlc.h    | 17 -----------------
 2 files changed, 2 insertions(+), 36 deletions(-)
 delete mode 100644 include/linux/mtd/lpc32xx_mlc.h
drivers/mtd/nand/raw/lpc32xx_mlc.c +2 -19
index 8f6a89d9ba83..8436015edcb4 100644
@@ -26,7 +26,6 @@
 #include <linux/interrupt.h>
 #include <linux/of.h>
 #include <linux/gpio/consumer.h>
-#include <linux/mtd/lpc32xx_mlc.h>
 #include <linux/io.h>
 #include <linux/mm.h>
 #include <linux/dma-mapping.h>
@@ -174,7 +173,6 @@ static struct nand_bbt_descr lpc32xx_nand_bbt_mirror = {
 struct lpc32xx_nand_host {
 	struct platform_device	*pdev;
 	struct nand_chip	nand_chip;
-	struct lpc32xx_mlc_platform_data *pdata;
 	struct clk		*clk;
 	struct gpio_desc	*wp_gpio;
 	void __iomem		*io_base;
@@ -580,24 +578,11 @@ static void lpc32xx_ecc_enable(struct nand_chip *chip, int mode)
 static int lpc32xx_dma_setup(struct lpc32xx_nand_host *host)
 {
 	struct mtd_info *mtd = nand_to_mtd(&host->nand_chip);
-	dma_cap_mask_t mask;
 
 	host->dma_chan = dma_request_chan(mtd->dev.parent, "rx-tx");
 	if (IS_ERR(host->dma_chan)) {
-		/* fallback to request using platform data */
-		if (!host->pdata || !host->pdata->dma_filter) {
-			dev_err(mtd->dev.parent, "no DMA platform data\n");
-			return -ENOENT;
-		}
-
-		dma_cap_zero(mask);
-		dma_cap_set(DMA_SLAVE, mask);
-		host->dma_chan = dma_request_channel(mask, host->pdata->dma_filter, "nand-mlc");
-
-		if (!host->dma_chan) {
-			dev_err(mtd->dev.parent, "Failed to request DMA channel\n");
-			return -EBUSY;
-		}
+		dev_err(mtd->dev.parent, "Failed to request DMA channel\n");
+		return PTR_ERR(host->dma_chan);
 	}
 
 	/*
@@ -736,8 +721,6 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
 
 	gpiod_set_consumer_name(host->wp_gpio, "NAND WP");
 
-	host->pdata = dev_get_platdata(&pdev->dev);
-
 	/* link the private data structures */
 	nand_set_controller_data(nand_chip, host);
 	nand_set_flash_node(nand_chip, pdev->dev.of_node);
include/linux/mtd/lpc32xx_mlc.h deleted +0 -17
deleted file mode 100644
index 35e971be0950..000000000000
@@ -1,17 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Platform data for LPC32xx SoC MLC NAND controller
- *
- * Copyright © 2012 Roland Stigge
- */
-
-#ifndef __LINUX_MTD_LPC32XX_MLC_H
-#define __LINUX_MTD_LPC32XX_MLC_H
-
-#include <linux/dmaengine.h>
-
-struct lpc32xx_mlc_platform_data {
-	dma_filter_fn dma_filter;
-};
-
-#endif  /* __LINUX_MTD_LPC32XX_MLC_H */
Signature · 6 lines
2.51.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
maintainer
#3 lore raw
In reply to Vladimir Zapolskiy

Hello Vladimir,

Quoted 8 lines · Vladimir Zapolskiy

Since NXP LPC32xx SoC support in the Linux kernel strictly depends on device tree support, the unused platform data support can be removed from the LPC32xx NAND MLC and SLC drivers.

Vladimir Zapolskiy (2):
mtd: rawnand: lpc32xx_slc: Remove platform data support
mtd: rawnand: lpc32xx_mlc: Remove platform data support

Quoted 7 lines
 drivers/mtd/nand/raw/lpc32xx_mlc.c | 21 ++-------------------
 drivers/mtd/nand/raw/lpc32xx_slc.c | 21 ++-------------------
 include/linux/mtd/lpc32xx_mlc.h    | 17 -----------------
 include/linux/mtd/lpc32xx_slc.h    | 17 -----------------
 4 files changed, 4 insertions(+), 72 deletions(-)
 delete mode 100644 include/linux/mtd/lpc32xx_mlc.h
 delete mode 100644 include/linux/mtd/lpc32xx_slc.h

Sashiko raises a build issue due to the cleanup missing one use of a header. Can you please check?

Thanks,
Miquèl

#4 lore raw

Hi Miquel,

Quoted 20 lines · Miquel Raynal

Hello Vladimir,

Quoted 8 lines · Vladimir Zapolskiy

Since NXP LPC32xx SoC support in the Linux kernel strictly depends on device tree support, the unused platform data support can be removed from the LPC32xx NAND MLC and SLC drivers.

Vladimir Zapolskiy (2):
mtd: rawnand: lpc32xx_slc: Remove platform data support
mtd: rawnand: lpc32xx_mlc: Remove platform data support

Quoted 7 lines
  drivers/mtd/nand/raw/lpc32xx_mlc.c | 21 ++-------------------
  drivers/mtd/nand/raw/lpc32xx_slc.c | 21 ++-------------------
  include/linux/mtd/lpc32xx_mlc.h    | 17 -----------------
  include/linux/mtd/lpc32xx_slc.h    | 17 -----------------
  4 files changed, 4 insertions(+), 72 deletions(-)

delete mode 100644 include/linux/mtd/lpc32xx_mlc.h delete mode 100644 include/linux/mtd/lpc32xx_slc.h

Quoted 3 lines

Sashiko raises a build issue due to the cleanup missing one use of a header. Can you please check?

sure, from its report [1] I see that Sashiko bot verifies the changes against today's outdated v7.2, and therefore it produced a false positive error, since v7.3-rc1 contains the commit d6ef4391897d ("ARM: lpc32xx:
remove a few manually populated OF devices").

There should be no build errors introduced by this series, thanks for review.

[1] https://sashiko.dev/#/patchset/20260903112425.1904748-1-vz%40kernel.org

Signature · 6 lines
Best wishes,
Vladimir

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
maintainer
#5 lore raw

Hi Vladimir,

Quoted 26 lines · Vladimir Zapolskiy

Hi Miquel,

Quoted 19 lines · Miquel Raynal

Hello Vladimir,

Quoted 8 lines · Vladimir Zapolskiy

Since NXP LPC32xx SoC support in the Linux kernel strictly depends on device tree support, the unused platform data support can be removed from the LPC32xx NAND MLC and SLC drivers.

Vladimir Zapolskiy (2):
mtd: rawnand: lpc32xx_slc: Remove platform data support
mtd: rawnand: lpc32xx_mlc: Remove platform data support

Quoted 7 lines
  drivers/mtd/nand/raw/lpc32xx_mlc.c | 21 ++-------------------
  drivers/mtd/nand/raw/lpc32xx_slc.c | 21 ++-------------------
  include/linux/mtd/lpc32xx_mlc.h    | 17 -----------------
  include/linux/mtd/lpc32xx_slc.h    | 17 -----------------
  4 files changed, 4 insertions(+), 72 deletions(-)

delete mode 100644 include/linux/mtd/lpc32xx_mlc.h delete mode 100644 include/linux/mtd/lpc32xx_slc.h

Quoted 3 lines

Sashiko raises a build issue due to the cleanup missing one use of a header. Can you please check?

Quoted 8 lines

sure, from its report [1] I see that Sashiko bot verifies the changes against today's outdated v7.2, and therefore it produced a false positive error, since v7.3-rc1 contains the commit d6ef4391897d ("ARM: lpc32xx:
remove a few manually populated OF devices").

There should be no build errors introduced by this series, thanks for review.

[1] https://sashiko.dev/#/patchset/20260903112425.1904748-1-vz%40kernel.org

In this case that's all good, thanks for checking!

Miquèl

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

maintainer Applied
#6 lore raw
In reply to Vladimir Zapolskiy
Quoted 9 lines · Vladimir Zapolskiy

Since NXP LPC32xx SoC support in the Linux kernel strictly depends on device tree support, the unused platform data support can be removed from the LPC32xx NAND MLC and SLC drivers.

Vladimir Zapolskiy (2):
mtd: rawnand: lpc32xx_slc: Remove platform data support
mtd: rawnand: lpc32xx_mlc: Remove platform data support

[...]

Applied to nand/next, thanks!

[1/2] mtd: rawnand: lpc32xx_slc: Remove platform data support

      commit: e18c514e9c1ff330bec87fd62341251d041e7443
[2/2] mtd: rawnand: lpc32xx_mlc: Remove platform data support
      commit: def559a215699aa2f2d8ef98f30156b9d562a154

Patche(s) should be available on mtd/linux.git and will be part of the next PR (provided that no robot complains by then).

Kind regards,
Miquèl

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