Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1515112 > unrolled thread

[PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error

Started byMasahiro Yamada <yamada.masahiro@socionext.com>
First post2016-11-04 11:50 +0100
Last post2016-11-07 00:00 +0100
Articles 20 on this page of 28 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 07/22] mtd: nand: orion: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 01/22] mtd: nand: ams-delta: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 20/22] mtd: nand: pxa3xx: return error code of nand_scan_ident() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 19/22] mtd: nand: hisi504: return error code of nand_scan_ident() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 14/22] mtd: nand: mediatek: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 11/22] mtd: nand: brcmnand: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 17/22] mtd: nand: vf610: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 16/22] mtd: nand: omap2: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 12/22] mtd: nand: fsmc: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 08/22] mtd: nand: pasemi: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 18/22] mtd: nand: cafe: return error code of nand_scan_ident() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 21/22] mtd: nand: nandsim: remove unneeded checks for nand_scan_ident/tail() Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 09/22] mtd: nand: plat_nand: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 10/22] mtd: nand: atmel: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 06/22] mtd: nand: tmio: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 22/22] mtd: nand: socrates: use nand_scan() for nand_scan_ident/tail() combo Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 15/22] mtd: nand: mxc: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 03/22] mtd: nand: cs553x: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 13/22] mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
      Re: [PATCH 13/22] mtd: nand: lpc32xx: return error code of  nand_scan_ident/tail() on error Vladimir Zapolskiy <vz@mleia.com> - 2016-11-06 02:40 +0100
      Re: [PATCH 13/22] mtd: nand: lpc32xx: return error code of  nand_scan_ident/tail() on error Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-11-06 19:40 +0100
        Re: [PATCH 13/22] mtd: nand: lpc32xx: return error code of  nand_scan_ident/tail() on error Vladimir Zapolskiy <vz@mleia.com> - 2016-11-07 01:40 +0100
    [PATCH 05/22] mtd: nand: mpc5121: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 02/22] mtd: nand: cmx270: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    [PATCH 04/22] mtd: nand: gpio: return error code of nand_scan() on error Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-04 11:50 +0100
    Re: [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,  _tail) on error Marek Vasut <marek.vasut@gmail.com> - 2016-11-05 08:40 +0100
    Re: [PATCH 00/22] mtd: nand: return error code of  nand_scan(_ident,_tail) on error Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-11-07 00:00 +0100

Page 1 of 2  [1] 2  Next page →


#1515112 — [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error
Message-ID<szKel-yl-11@gated-at.bofh.it>
nand_scan(), nand_scan_ident(), nand_scan_tail() return
an appropriate negative value on error.

Most of drivers return the value from them on error,
but some of them return the fixed error code -ENXIO
(and a few return -ENODEV).

This series make those drivers return more precise error code.


Masahiro Yamada (22):
  mtd: nand: ams-delta: return error code of nand_scan() on error
  mtd: nand: cmx270: return error code of nand_scan() on error
  mtd: nand: cs553x: return error code of nand_scan() on error
  mtd: nand: gpio: return error code of nand_scan() on error
  mtd: nand: mpc5121: return error code of nand_scan() on error
  mtd: nand: tmio: return error code of nand_scan() on error
  mtd: nand: orion: return error code of nand_scan() on error
  mtd: nand: pasemi: return error code of nand_scan() on error
  mtd: nand: plat_nand: return error code of nand_scan() on error
  mtd: nand: atmel: return error code of nand_scan_ident/tail() on error
  mtd: nand: brcmnand: return error code of nand_scan_ident/tail() on
    error
  mtd: nand: fsmc: return error code of nand_scan_ident/tail() on error
  mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on
    error
  mtd: nand: mediatek: return error code of nand_scan_ident/tail() on
    error
  mtd: nand: mxc: return error code of nand_scan_ident/tail() on error
  mtd: nand: omap2: return error code of nand_scan_ident/tail() on error
  mtd: nand: vf610: return error code of nand_scan_ident/tail() on error
  mtd: nand: cafe: return error code of nand_scan_ident() on error
  mtd: nand: hisi504: return error code of nand_scan_ident() on error
  mtd: nand: pxa3xx: return error code of nand_scan_ident() on error
  mtd: nand: nandsim: remove unneeded checks for nand_scan_ident/tail()
  mtd: nand: socrates: use nand_scan() for nand_scan_ident/tail() combo

 drivers/mtd/nand/ams-delta.c         |  5 ++---
 drivers/mtd/nand/atmel_nand.c        | 10 ++++------
 drivers/mtd/nand/brcmnand/brcmnand.c | 10 ++++++----
 drivers/mtd/nand/cafe_nand.c         |  5 ++---
 drivers/mtd/nand/cmx270_nand.c       |  4 ++--
 drivers/mtd/nand/cs553x_nand.c       |  5 ++---
 drivers/mtd/nand/fsmc_nand.c         |  9 ++++-----
 drivers/mtd/nand/gpio.c              |  5 ++---
 drivers/mtd/nand/hisi504_nand.c      |  4 +---
 drivers/mtd/nand/lpc32xx_mlc.c       | 10 ++++------
 drivers/mtd/nand/lpc32xx_slc.c       |  9 +++------
 drivers/mtd/nand/mpc5121_nfc.c       |  4 ++--
 drivers/mtd/nand/mtk_nand.c          |  4 ++--
 drivers/mtd/nand/mxc_nand.c          | 10 ++++------
 drivers/mtd/nand/nandsim.c           |  4 ----
 drivers/mtd/nand/omap2.c             |  9 ++++-----
 drivers/mtd/nand/orion_nand.c        |  5 ++---
 drivers/mtd/nand/pasemi_nand.c       |  5 ++---
 drivers/mtd/nand/plat_nand.c         |  5 ++---
 drivers/mtd/nand/pxa3xx_nand.c       |  5 +++--
 drivers/mtd/nand/socrates_nand.c     | 12 ++----------
 drivers/mtd/nand/tmio_nand.c         |  6 +++---
 drivers/mtd/nand/vf610_nfc.c         | 10 ++++------
 23 files changed, 62 insertions(+), 93 deletions(-)

-- 
1.9.1

[toc] | [next] | [standalone]


#1515113 — [PATCH 07/22] mtd: nand: orion: return error code of nand_scan() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 07/22] mtd: nand: orion: return error code of nand_scan() on error
Message-ID<szKem-yl-25@gated-at.bofh.it>
In reply to#1515112
The nand_scan() returns an appropriate error value when it fails.
Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/orion_nand.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index 40a7c4a..4a91c5d 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -155,10 +155,9 @@ static int __init orion_nand_probe(struct platform_device *pdev)
 		clk_put(clk);
 	}
 
-	if (nand_scan(mtd, 1)) {
-		ret = -ENXIO;
+	ret = nand_scan(mtd, 1);
+	if (ret)
 		goto no_dev;
-	}
 
 	mtd->name = "orion_nand";
 	ret = mtd_device_register(mtd, board->parts, board->nr_parts);
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515114 — [PATCH 01/22] mtd: nand: ams-delta: return error code of nand_scan() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 01/22] mtd: nand: ams-delta: return error code of nand_scan() on error
Message-ID<szKel-yl-13@gated-at.bofh.it>
In reply to#1515112
The nand_scan() returns an appropriate error value when it fails.
Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/ams-delta.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c
index 78e12cc..5d6c26f 100644
--- a/drivers/mtd/nand/ams-delta.c
+++ b/drivers/mtd/nand/ams-delta.c
@@ -234,10 +234,9 @@ static int ams_delta_init(struct platform_device *pdev)
 		goto out_gpio;
 
 	/* Scan to find existence of the device */
-	if (nand_scan(ams_delta_mtd, 1)) {
-		err = -ENXIO;
+	err = nand_scan(ams_delta_mtd, 1);
+	if (err)
 		goto out_mtd;
-	}
 
 	/* Register the partitions */
 	mtd_device_register(ams_delta_mtd, partition_info,
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515115 — [PATCH 20/22] mtd: nand: pxa3xx: return error code of nand_scan_ident() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 20/22] mtd: nand: pxa3xx: return error code of nand_scan_ident() on error
Message-ID<szKel-yl-19@gated-at.bofh.it>
In reply to#1515112
The nand_scan_ident() returns an appropriate error value when it
fails.  Use it instead of the fixed error code -ENODEV.
(This driver is already doing so for nand_scan_tail().)

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/pxa3xx_nand.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index b121bf4..06afa5f 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1680,8 +1680,9 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
 	chip->ecc.strength = pdata->ecc_strength;
 	chip->ecc.size = pdata->ecc_step_size;
 
-	if (nand_scan_ident(mtd, 1, NULL))
-		return -ENODEV;
+	ret = nand_scan_ident(mtd, 1, NULL);
+	if (ret)
+		return ret;
 
 	if (!pdata->keep_config) {
 		ret = pxa3xx_nand_init(host);
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515116 — [PATCH 19/22] mtd: nand: hisi504: return error code of nand_scan_ident() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 19/22] mtd: nand: hisi504: return error code of nand_scan_ident() on error
Message-ID<szKem-yl-37@gated-at.bofh.it>
In reply to#1515112
The nand_scan_ident() returns an appropriate error value when it
fails.  Use it instead of the fixed error code -ENODEV.
(This driver is already doing so for nand_scan_tail().)

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/hisi504_nand.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/hisi504_nand.c b/drivers/mtd/nand/hisi504_nand.c
index 9432546..e40364e 100644
--- a/drivers/mtd/nand/hisi504_nand.c
+++ b/drivers/mtd/nand/hisi504_nand.c
@@ -774,10 +774,8 @@ static int hisi_nfc_probe(struct platform_device *pdev)
 	}
 
 	ret = nand_scan_ident(mtd, max_chips, NULL);
-	if (ret) {
-		ret = -ENODEV;
+	if (ret)
 		goto err_res;
-	}
 
 	host->buffer = dmam_alloc_coherent(dev, mtd->writesize + mtd->oobsize,
 		&host->dma_buffer, GFP_KERNEL);
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515117 — [PATCH 14/22] mtd: nand: mediatek: return error code of nand_scan_ident/tail() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 14/22] mtd: nand: mediatek: return error code of nand_scan_ident/tail() on error
Message-ID<szKem-yl-39@gated-at.bofh.it>
In reply to#1515112
The nand_scan_ident/tail() returns an appropriate error value when
it fails.  Use it instead of the fixed error code -ENODEV.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/mtk_nand.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/mtk_nand.c b/drivers/mtd/nand/mtk_nand.c
index 5223a21..6c3eed3 100644
--- a/drivers/mtd/nand/mtk_nand.c
+++ b/drivers/mtd/nand/mtk_nand.c
@@ -1297,7 +1297,7 @@ static int mtk_nfc_nand_chip_init(struct device *dev, struct mtk_nfc *nfc,
 
 	ret = nand_scan_ident(mtd, nsels, NULL);
 	if (ret)
-		return -ENODEV;
+		return ret;
 
 	/* store bbt magic in page, cause OOB is not protected */
 	if (nand->bbt_options & NAND_BBT_USE_FLASH)
@@ -1323,7 +1323,7 @@ static int mtk_nfc_nand_chip_init(struct device *dev, struct mtk_nfc *nfc,
 
 	ret = nand_scan_tail(mtd);
 	if (ret)
-		return -ENODEV;
+		return ret;
 
 	ret = mtd_device_parse_register(mtd, NULL, NULL, NULL, 0);
 	if (ret) {
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515118 — [PATCH 11/22] mtd: nand: brcmnand: return error code of nand_scan_ident/tail() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 11/22] mtd: nand: brcmnand: return error code of nand_scan_ident/tail() on error
Message-ID<szKem-yl-29@gated-at.bofh.it>
In reply to#1515112
The nand_scan_ident/tail() returns an appropriate error value when
it fails.  Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/brcmnand/brcmnand.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/brcmnand/brcmnand.c b/drivers/mtd/nand/brcmnand/brcmnand.c
index 9d2424b..42ebd73 100644
--- a/drivers/mtd/nand/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/brcmnand/brcmnand.c
@@ -2209,8 +2209,9 @@ static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn)
 	nand_writereg(ctrl, cfg_offs,
 		      nand_readreg(ctrl, cfg_offs) & ~CFG_BUS_WIDTH);
 
-	if (nand_scan_ident(mtd, 1, NULL))
-		return -ENXIO;
+	ret = nand_scan_ident(mtd, 1, NULL);
+	if (ret)
+		return ret;
 
 	chip->options |= NAND_NO_SUBPAGE_WRITE;
 	/*
@@ -2234,8 +2235,9 @@ static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn)
 	if (ret)
 		return ret;
 
-	if (nand_scan_tail(mtd))
-		return -ENXIO;
+	ret = nand_scan_tail(mtd);
+	if (ret)
+		return ret;
 
 	return mtd_device_register(mtd, NULL, 0);
 }
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515119 — [PATCH 17/22] mtd: nand: vf610: return error code of nand_scan_ident/tail() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 17/22] mtd: nand: vf610: return error code of nand_scan_ident/tail() on error
Message-ID<szKem-yl-27@gated-at.bofh.it>
In reply to#1515112
The nand_scan_ident/tail() returns an appropriate error value when
it fails.  Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/vf610_nfc.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
index 3ad514c..3ea4bb1 100644
--- a/drivers/mtd/nand/vf610_nfc.c
+++ b/drivers/mtd/nand/vf610_nfc.c
@@ -717,10 +717,9 @@ static int vf610_nfc_probe(struct platform_device *pdev)
 	vf610_nfc_preinit_controller(nfc);
 
 	/* first scan to find the device and get the page size */
-	if (nand_scan_ident(mtd, 1, NULL)) {
-		err = -ENXIO;
+	err = nand_scan_ident(mtd, 1, NULL);
+	if (err)
 		goto error;
-	}
 
 	vf610_nfc_init_controller(nfc);
 
@@ -775,10 +774,9 @@ static int vf610_nfc_probe(struct platform_device *pdev)
 	}
 
 	/* second phase scan */
-	if (nand_scan_tail(mtd)) {
-		err = -ENXIO;
+	err = nand_scan_tail(mtd);
+	if (err)
 		goto error;
-	}
 
 	platform_set_drvdata(pdev, mtd);
 
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515120 — [PATCH 16/22] mtd: nand: omap2: return error code of nand_scan_ident/tail() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 16/22] mtd: nand: omap2: return error code of nand_scan_ident/tail() on error
Message-ID<szKem-yl-51@gated-at.bofh.it>
In reply to#1515112
The nand_scan_ident/tail() returns an appropriate error value when
it fails.  Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/omap2.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 5513bfd9..6c985d3 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1895,10 +1895,10 @@ static int omap_nand_probe(struct platform_device *pdev)
 
 	/* scan NAND device connected to chip controller */
 	nand_chip->options |= info->devsize & NAND_BUSWIDTH_16;
-	if (nand_scan_ident(mtd, 1, NULL)) {
+	err = nand_scan_ident(mtd, 1, NULL);
+	if (err) {
 		dev_err(&info->pdev->dev,
 			"scan failed, may be bus-width mismatch\n");
-		err = -ENXIO;
 		goto return_error;
 	}
 
@@ -2154,10 +2154,9 @@ static int omap_nand_probe(struct platform_device *pdev)
 
 scan_tail:
 	/* second phase scan */
-	if (nand_scan_tail(mtd)) {
-		err = -ENXIO;
+	err = nand_scan_tail(mtd);
+	if (err)
 		goto return_error;
-	}
 
 	if (dev->of_node)
 		mtd_device_register(mtd, NULL, 0);
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515121 — [PATCH 12/22] mtd: nand: fsmc: return error code of nand_scan_ident/tail() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 12/22] mtd: nand: fsmc: return error code of nand_scan_ident/tail() on error
Message-ID<szKem-yl-41@gated-at.bofh.it>
In reply to#1515112
The nand_scan_ident/tail() returns an appropriate error value when
it fails.  Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/fsmc_nand.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index d4f454a..4924b43 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -926,8 +926,8 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
 	/*
 	 * Scan to find existence of the device
 	 */
-	if (nand_scan_ident(mtd, 1, NULL)) {
-		ret = -ENXIO;
+	ret = nand_scan_ident(mtd, 1, NULL);
+	if (ret) {
 		dev_err(&pdev->dev, "No NAND Device found!\n");
 		goto err_scan_ident;
 	}
@@ -992,10 +992,9 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
 	}
 
 	/* Second stage of scan to fill MTD data-structures */
-	if (nand_scan_tail(mtd)) {
-		ret = -ENXIO;
+	ret = nand_scan_tail(mtd);
+	if (ret)
 		goto err_probe;
-	}
 
 	/*
 	 * The partition information can is accessed by (in the same precedence)
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515122 — [PATCH 08/22] mtd: nand: pasemi: return error code of nand_scan() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 08/22] mtd: nand: pasemi: return error code of nand_scan() on error
Message-ID<szKem-yl-43@gated-at.bofh.it>
In reply to#1515112
The nand_scan() returns an appropriate error value when it fails.
Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/pasemi_nand.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
index 5de7591..074b8b0 100644
--- a/drivers/mtd/nand/pasemi_nand.c
+++ b/drivers/mtd/nand/pasemi_nand.c
@@ -156,10 +156,9 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
 	chip->bbt_options = NAND_BBT_USE_FLASH;
 
 	/* Scan to find existence of the device */
-	if (nand_scan(pasemi_nand_mtd, 1)) {
-		err = -ENXIO;
+	err = nand_scan(pasemi_nand_mtd, 1);
+	if (err)
 		goto out_lpc;
-	}
 
 	if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) {
 		dev_err(dev, "Unable to register MTD device\n");
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515123 — [PATCH 18/22] mtd: nand: cafe: return error code of nand_scan_ident() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 18/22] mtd: nand: cafe: return error code of nand_scan_ident() on error
Message-ID<szKem-yl-33@gated-at.bofh.it>
In reply to#1515112
The nand_scan_ident() returns an appropriate error value when it
fails.  Use it instead of the fixed error code -ENXIO.
(This driver is already doing so for nand_scan_tail().)

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/cafe_nand.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
index 0b0c937..d40c32d 100644
--- a/drivers/mtd/nand/cafe_nand.c
+++ b/drivers/mtd/nand/cafe_nand.c
@@ -725,10 +725,9 @@ static int cafe_nand_probe(struct pci_dev *pdev,
 	usedma = 0;
 
 	/* Scan to find existence of the device */
-	if (nand_scan_ident(mtd, 2, NULL)) {
-		err = -ENXIO;
+	err = nand_scan_ident(mtd, 2, NULL);
+	if (err)
 		goto out_irq;
-	}
 
 	cafe->dmabuf = dma_alloc_coherent(&cafe->pdev->dev,
 				2112 + sizeof(struct nand_buffers) +
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515124 — [PATCH 21/22] mtd: nand: nandsim: remove unneeded checks for nand_scan_ident/tail()

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 21/22] mtd: nand: nandsim: remove unneeded checks for nand_scan_ident/tail()
Message-ID<szKem-yl-55@gated-at.bofh.it>
In reply to#1515112
The nand_scan_ident/tail() never returns a positive value when it
fails.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/nandsim.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index 1eb9344..c76287a 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -2313,8 +2313,6 @@ static int __init ns_init_module(void)
 	retval = nand_scan_ident(nsmtd, 1, NULL);
 	if (retval) {
 		NS_ERR("cannot scan NAND Simulator device\n");
-		if (retval > 0)
-			retval = -ENXIO;
 		goto error;
 	}
 
@@ -2350,8 +2348,6 @@ static int __init ns_init_module(void)
 	retval = nand_scan_tail(nsmtd);
 	if (retval) {
 		NS_ERR("can't register NAND Simulator\n");
-		if (retval > 0)
-			retval = -ENXIO;
 		goto error;
 	}
 
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515125 — [PATCH 09/22] mtd: nand: plat_nand: return error code of nand_scan() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 09/22] mtd: nand: plat_nand: return error code of nand_scan() on error
Message-ID<szKem-yl-45@gated-at.bofh.it>
In reply to#1515112
The nand_scan() returns an appropriate error value when it fails.
Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/plat_nand.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c
index 415a53a..791de3e 100644
--- a/drivers/mtd/nand/plat_nand.c
+++ b/drivers/mtd/nand/plat_nand.c
@@ -86,10 +86,9 @@ static int plat_nand_probe(struct platform_device *pdev)
 	}
 
 	/* Scan to find existence of the device */
-	if (nand_scan(mtd, pdata->chip.nr_chips)) {
-		err = -ENXIO;
+	err = nand_scan(mtd, pdata->chip.nr_chips);
+	if (err)
 		goto out;
-	}
 
 	part_types = pdata->chip.part_probe_types;
 
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515126 — [PATCH 10/22] mtd: nand: atmel: return error code of nand_scan_ident/tail() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 10/22] mtd: nand: atmel: return error code of nand_scan_ident/tail() on error
Message-ID<szKem-yl-57@gated-at.bofh.it>
In reply to#1515112
The nand_scan_ident/tail() returns an appropriate error value when
it fails.  Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/atmel_nand.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 68b9160..9ebd5ec 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -2267,10 +2267,9 @@ static int atmel_nand_probe(struct platform_device *pdev)
 		dev_info(host->dev, "No DMA support for NAND access.\n");
 
 	/* first scan to find the device and get the page size */
-	if (nand_scan_ident(mtd, 1, NULL)) {
-		res = -ENXIO;
+	res = nand_scan_ident(mtd, 1, NULL);
+	if (res)
 		goto err_scan_ident;
-	}
 
 	if (host->board.on_flash_bbt || on_flash_bbt)
 		nand_chip->bbt_options |= NAND_BBT_USE_FLASH;
@@ -2304,10 +2303,9 @@ static int atmel_nand_probe(struct platform_device *pdev)
 	}
 
 	/* second phase scan */
-	if (nand_scan_tail(mtd)) {
-		res = -ENXIO;
+	res = nand_scan_tail(mtd);
+	if (res)
 		goto err_scan_tail;
-	}
 
 	mtd->name = "atmel_nand";
 	res = mtd_device_register(mtd, host->board.parts,
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515127 — [PATCH 06/22] mtd: nand: tmio: return error code of nand_scan() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 06/22] mtd: nand: tmio: return error code of nand_scan() on error
Message-ID<szKem-yl-47@gated-at.bofh.it>
In reply to#1515112
The nand_scan() returns an appropriate error value when it fails.
Use it instead of the fixed error code -ENODEV.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/tmio_nand.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/tmio_nand.c b/drivers/mtd/nand/tmio_nand.c
index 08b3054..fc5e773 100644
--- a/drivers/mtd/nand/tmio_nand.c
+++ b/drivers/mtd/nand/tmio_nand.c
@@ -435,10 +435,10 @@ static int tmio_probe(struct platform_device *dev)
 	nand_chip->waitfunc = tmio_nand_wait;
 
 	/* Scan to find existence of the device */
-	if (nand_scan(mtd, 1)) {
-		retval = -ENODEV;
+	retval = nand_scan(mtd, 1);
+	if (retval)
 		goto err_irq;
-	}
+
 	/* Register the partitions */
 	retval = mtd_device_parse_register(mtd, NULL, NULL,
 					   data ? data->partition : NULL,
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515128 — [PATCH 22/22] mtd: nand: socrates: use nand_scan() for nand_scan_ident/tail() combo

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 22/22] mtd: nand: socrates: use nand_scan() for nand_scan_ident/tail() combo
Message-ID<szKem-yl-35@gated-at.bofh.it>
In reply to#1515112
For this driver, there is nothing between nand_scan_ident() and
nand_scan_tail().  They can be merged into nand_scan().

Also, nand_scan() returns an appropriate error value when it fails.
Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/socrates_nand.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/mtd/nand/socrates_nand.c b/drivers/mtd/nand/socrates_nand.c
index 888fd31..72369bd 100644
--- a/drivers/mtd/nand/socrates_nand.c
+++ b/drivers/mtd/nand/socrates_nand.c
@@ -187,17 +187,9 @@ static int socrates_nand_probe(struct platform_device *ofdev)
 
 	dev_set_drvdata(&ofdev->dev, host);
 
-	/* first scan to find the device and get the page size */
-	if (nand_scan_ident(mtd, 1, NULL)) {
-		res = -ENXIO;
+	res = nand_scan(mtd, 1);
+	if (res)
 		goto out;
-	}
-
-	/* second phase scan */
-	if (nand_scan_tail(mtd)) {
-		res = -ENXIO;
-		goto out;
-	}
 
 	res = mtd_device_register(mtd, NULL, 0);
 	if (!res)
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515129 — [PATCH 15/22] mtd: nand: mxc: return error code of nand_scan_ident/tail() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 15/22] mtd: nand: mxc: return error code of nand_scan_ident/tail() on error
Message-ID<szKen-yl-63@gated-at.bofh.it>
In reply to#1515112
The nand_scan_ident/tail() returns an appropriate error value when
it fails.  Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/mxc_nand.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index d7f724b..61ca020 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -1747,10 +1747,9 @@ static int mxcnd_probe(struct platform_device *pdev)
 	}
 
 	/* first scan to find the device and get the page size */
-	if (nand_scan_ident(mtd, is_imx25_nfc(host) ? 4 : 1, NULL)) {
-		err = -ENXIO;
+	err = nand_scan_ident(mtd, is_imx25_nfc(host) ? 4 : 1, NULL);
+	if (err)
 		goto escan;
-	}
 
 	switch (this->ecc.mode) {
 	case NAND_ECC_HW:
@@ -1808,10 +1807,9 @@ static int mxcnd_probe(struct platform_device *pdev)
 	}
 
 	/* second phase scan */
-	if (nand_scan_tail(mtd)) {
-		err = -ENXIO;
+	err = nand_scan_tail(mtd);
+	if (err)
 		goto escan;
-	}
 
 	/* Register the partitions */
 	mtd_device_parse_register(mtd, part_probes,
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515130 — [PATCH 03/22] mtd: nand: cs553x: return error code of nand_scan() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 03/22] mtd: nand: cs553x: return error code of nand_scan() on error
Message-ID<szKen-yl-69@gated-at.bofh.it>
In reply to#1515112
The nand_scan() returns an appropriate error value when it fails.
Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/cs553x_nand.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/cs553x_nand.c b/drivers/mtd/nand/cs553x_nand.c
index a65e4e0..594b286 100644
--- a/drivers/mtd/nand/cs553x_nand.c
+++ b/drivers/mtd/nand/cs553x_nand.c
@@ -242,10 +242,9 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)
 	}
 
 	/* Scan to find existence of the device */
-	if (nand_scan(new_mtd, 1)) {
-		err = -ENXIO;
+	err = nand_scan(new_mtd, 1);
+	if (err)
 		goto out_free;
-	}
 
 	cs553x_mtd[cs] = new_mtd;
 	goto out;
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1515131 — [PATCH 13/22] mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on error

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-04 11:50 +0100
Subject[PATCH 13/22] mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on error
Message-ID<szKen-yl-59@gated-at.bofh.it>
In reply to#1515112
The nand_scan_ident/tail() returns an appropriate error value when
it fails.  Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/lpc32xx_mlc.c | 10 ++++------
 drivers/mtd/nand/lpc32xx_slc.c |  9 +++------
 2 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/drivers/mtd/nand/lpc32xx_mlc.c b/drivers/mtd/nand/lpc32xx_mlc.c
index 8523881..5553a5d 100644
--- a/drivers/mtd/nand/lpc32xx_mlc.c
+++ b/drivers/mtd/nand/lpc32xx_mlc.c
@@ -747,10 +747,9 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
 	 * Scan to find existance of the device and
 	 * Get the type of NAND device SMALL block or LARGE block
 	 */
-	if (nand_scan_ident(mtd, 1, NULL)) {
-		res = -ENXIO;
+	res = nand_scan_ident(mtd, 1, NULL);
+	if (res)
 		goto err_exit3;
-	}
 
 	host->dma_buf = devm_kzalloc(&pdev->dev, mtd->writesize, GFP_KERNEL);
 	if (!host->dma_buf) {
@@ -793,10 +792,9 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
 	 * Fills out all the uninitialized function pointers with the defaults
 	 * And scans for a bad block table if appropriate.
 	 */
-	if (nand_scan_tail(mtd)) {
-		res = -ENXIO;
+	res = nand_scan_tail(mtd);
+	if (res)
 		goto err_exit4;
-	}
 
 	mtd->name = DRV_NAME;
 
diff --git a/drivers/mtd/nand/lpc32xx_slc.c b/drivers/mtd/nand/lpc32xx_slc.c
index 8d3edc3..f1094e5 100644
--- a/drivers/mtd/nand/lpc32xx_slc.c
+++ b/drivers/mtd/nand/lpc32xx_slc.c
@@ -894,10 +894,9 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
 	}
 
 	/* Find NAND device */
-	if (nand_scan_ident(mtd, 1, NULL)) {
-		res = -ENXIO;
+	res = nand_scan_ident(mtd, 1, NULL);
+	if (res)
 		goto err_exit3;
-	}
 
 	/* OOB and ECC CPU and DMA work areas */
 	host->ecc_buf = (uint32_t *)(host->data_buf + LPC32XX_DMA_DATA_SIZE);
@@ -929,10 +928,8 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
 	/*
 	 * Fills out all the uninitialized function pointers with the defaults
 	 */
-	if (nand_scan_tail(mtd)) {
-		res = -ENXIO;
+	res = nand_scan_tail(mtd);
 		goto err_exit3;
-	}
 
 	mtd->name = "nxp_lpc3220_slc";
 	res = mtd_device_register(mtd, host->ncfg->parts,
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | linux.kernel


csiph-web