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

STALE3568d

4 messages, 3 authors, 2016-11-06 · open the first message on its own page

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

From: Masahiro Yamada <hidden>
Date: 2016-11-04 10:42:59

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

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

From: Masahiro Yamada <hidden>
Date: 2016-11-04 10:43:52

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 <redacted>
---

 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

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

From: Marek Vasut <hidden>
Date: 2016-11-05 07:36:09

On 11/04/2016 11:42 AM, Masahiro Yamada wrote:
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.
Reviewed-by: Marek Vasut <redacted>

Nice cleanup, thanks!

-- 
Best regards,
Marek Vasut

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

From: Boris Brezillon <hidden>
Date: 2016-11-06 22:55:57

On Fri,  4 Nov 2016 19:42:48 +0900
Masahiro Yamada [off-list ref] wrote:
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.
Applied and fixed the bug I found in patch 13.

Thanks,

Boris

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(-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help