linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error
@ 2016-11-04 10:42 Masahiro Yamada
  2016-11-04 10:42 ` [PATCH 01/22] mtd: nand: ams-delta: return error code of nand_scan() " Masahiro Yamada
                   ` (23 more replies)
  0 siblings, 24 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:42 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, Sylvain Lemieux, Josh Wu, Matthias Brugger,
	Stefan Agner, Vladimir Zapolskiy, linux-mediatek, linux-kernel,
	Boris Brezillon, Brian Norris, Ezequiel Garcia,
	Richard Weinberger, David Woodhouse, Kamal Dasu,
	bcm-kernel-feedback-list, linuxppc-dev, Wenyou Yang,
	linux-arm-kernel


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

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

* [PATCH 01/22] mtd: nand: ams-delta: return error code of nand_scan() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
@ 2016-11-04 10:42 ` Masahiro Yamada
  2016-11-04 10:42 ` [PATCH 02/22] mtd: nand: cmx270: " Masahiro Yamada
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:42 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse

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

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

* [PATCH 02/22] mtd: nand: cmx270: return error code of nand_scan() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
  2016-11-04 10:42 ` [PATCH 01/22] mtd: nand: ams-delta: return error code of nand_scan() " Masahiro Yamada
@ 2016-11-04 10:42 ` Masahiro Yamada
  2016-11-04 10:42 ` [PATCH 03/22] mtd: nand: cs553x: " Masahiro Yamada
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:42 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse

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/cmx270_nand.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/cmx270_nand.c b/drivers/mtd/nand/cmx270_nand.c
index 4913378..226ac0b 100644
--- a/drivers/mtd/nand/cmx270_nand.c
+++ b/drivers/mtd/nand/cmx270_nand.c
@@ -195,9 +195,9 @@ static int __init cmx270_init(void)
 	this->write_buf = cmx270_write_buf;
 
 	/* Scan to find existence of the device */
-	if (nand_scan (cmx270_nand_mtd, 1)) {
+	ret = nand_scan(cmx270_nand_mtd, 1);
+	if (ret) {
 		pr_notice("No NAND device\n");
-		ret = -ENXIO;
 		goto err_scan;
 	}
 
-- 
1.9.1

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

* [PATCH 03/22] mtd: nand: cs553x: return error code of nand_scan() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
  2016-11-04 10:42 ` [PATCH 01/22] mtd: nand: ams-delta: return error code of nand_scan() " Masahiro Yamada
  2016-11-04 10:42 ` [PATCH 02/22] mtd: nand: cmx270: " Masahiro Yamada
@ 2016-11-04 10:42 ` Masahiro Yamada
  2016-11-04 10:42 ` [PATCH 04/22] mtd: nand: gpio: " Masahiro Yamada
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:42 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse

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

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

* [PATCH 04/22] mtd: nand: gpio: return error code of nand_scan() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (2 preceding siblings ...)
  2016-11-04 10:42 ` [PATCH 03/22] mtd: nand: cs553x: " Masahiro Yamada
@ 2016-11-04 10:42 ` Masahiro Yamada
  2016-11-04 10:42 ` [PATCH 05/22] mtd: nand: mpc5121: " Masahiro Yamada
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:42 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse

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/gpio.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c
index 6317f68..0d24857 100644
--- a/drivers/mtd/nand/gpio.c
+++ b/drivers/mtd/nand/gpio.c
@@ -286,10 +286,9 @@ static int gpio_nand_probe(struct platform_device *pdev)
 	if (gpio_is_valid(gpiomtd->plat.gpio_nwp))
 		gpio_direction_output(gpiomtd->plat.gpio_nwp, 1);
 
-	if (nand_scan(mtd, 1)) {
-		ret = -ENXIO;
+	ret = nand_scan(mtd, 1);
+	if (ret)
 		goto err_wp;
-	}
 
 	if (gpiomtd->plat.adjust_parts)
 		gpiomtd->plat.adjust_parts(&gpiomtd->plat, mtd->size);
-- 
1.9.1

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

* [PATCH 05/22] mtd: nand: mpc5121: return error code of nand_scan() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (3 preceding siblings ...)
  2016-11-04 10:42 ` [PATCH 04/22] mtd: nand: gpio: " Masahiro Yamada
@ 2016-11-04 10:42 ` Masahiro Yamada
  2016-11-04 10:42 ` [PATCH 06/22] mtd: nand: tmio: " Masahiro Yamada
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:42 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse

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/mpc5121_nfc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c
index 7eacb2f..6d6eaed 100644
--- a/drivers/mtd/nand/mpc5121_nfc.c
+++ b/drivers/mtd/nand/mpc5121_nfc.c
@@ -777,9 +777,9 @@ static int mpc5121_nfc_probe(struct platform_device *op)
 	}
 
 	/* Detect NAND chips */
-	if (nand_scan(mtd, be32_to_cpup(chips_no))) {
+	retval = nand_scan(mtd, be32_to_cpup(chips_no));
+	if (retval) {
 		dev_err(dev, "NAND Flash not found !\n");
-		retval = -ENXIO;
 		goto error;
 	}
 
-- 
1.9.1

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

* [PATCH 06/22] mtd: nand: tmio: return error code of nand_scan() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (4 preceding siblings ...)
  2016-11-04 10:42 ` [PATCH 05/22] mtd: nand: mpc5121: " Masahiro Yamada
@ 2016-11-04 10:42 ` Masahiro Yamada
  2016-11-04 10:42 ` [PATCH 07/22] mtd: nand: orion: " Masahiro Yamada
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:42 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse

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

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

* [PATCH 07/22] mtd: nand: orion: return error code of nand_scan() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (5 preceding siblings ...)
  2016-11-04 10:42 ` [PATCH 06/22] mtd: nand: tmio: " Masahiro Yamada
@ 2016-11-04 10:42 ` Masahiro Yamada
  2016-11-04 10:42 ` [PATCH 08/22] mtd: nand: pasemi: " Masahiro Yamada
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:42 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse

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

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

* [PATCH 08/22] mtd: nand: pasemi: return error code of nand_scan() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (6 preceding siblings ...)
  2016-11-04 10:42 ` [PATCH 07/22] mtd: nand: orion: " Masahiro Yamada
@ 2016-11-04 10:42 ` Masahiro Yamada
  2016-11-04 10:42 ` [PATCH 09/22] mtd: nand: plat_nand: " Masahiro Yamada
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:42 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse, linuxppc-dev

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

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

* [PATCH 09/22] mtd: nand: plat_nand: return error code of nand_scan() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (7 preceding siblings ...)
  2016-11-04 10:42 ` [PATCH 08/22] mtd: nand: pasemi: " Masahiro Yamada
@ 2016-11-04 10:42 ` Masahiro Yamada
  2016-11-04 10:42 ` [PATCH 10/22] mtd: nand: atmel: return error code of nand_scan_ident/tail() " Masahiro Yamada
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:42 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse

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

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

* [PATCH 10/22] mtd: nand: atmel: return error code of nand_scan_ident/tail() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (8 preceding siblings ...)
  2016-11-04 10:42 ` [PATCH 09/22] mtd: nand: plat_nand: " Masahiro Yamada
@ 2016-11-04 10:42 ` Masahiro Yamada
  2016-11-04 10:42 ` [PATCH 11/22] mtd: nand: brcmnand: " Masahiro Yamada
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:42 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, Josh Wu, linux-kernel, Boris Brezillon,
	Brian Norris, Richard Weinberger, David Woodhouse, Wenyou Yang

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

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

* [PATCH 11/22] mtd: nand: brcmnand: return error code of nand_scan_ident/tail() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (9 preceding siblings ...)
  2016-11-04 10:42 ` [PATCH 10/22] mtd: nand: atmel: return error code of nand_scan_ident/tail() " Masahiro Yamada
@ 2016-11-04 10:42 ` Masahiro Yamada
  2016-11-04 10:43 ` [PATCH 12/22] mtd: nand: fsmc: " Masahiro Yamada
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:42 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse, Kamal Dasu,
	bcm-kernel-feedback-list

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

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

* [PATCH 12/22] mtd: nand: fsmc: return error code of nand_scan_ident/tail() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (10 preceding siblings ...)
  2016-11-04 10:42 ` [PATCH 11/22] mtd: nand: brcmnand: " Masahiro Yamada
@ 2016-11-04 10:43 ` Masahiro Yamada
  2016-11-04 10:43 ` [PATCH 13/22] mtd: nand: lpc32xx: " Masahiro Yamada
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:43 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse

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

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

* [PATCH 13/22] mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (11 preceding siblings ...)
  2016-11-04 10:43 ` [PATCH 12/22] mtd: nand: fsmc: " Masahiro Yamada
@ 2016-11-04 10:43 ` Masahiro Yamada
  2016-11-06  1:37   ` Vladimir Zapolskiy
  2016-11-06 18:27   ` Boris Brezillon
  2016-11-04 10:43 ` [PATCH 14/22] mtd: nand: mediatek: " Masahiro Yamada
                   ` (10 subsequent siblings)
  23 siblings, 2 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:43 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, Sylvain Lemieux, linux-kernel, Boris Brezillon,
	Brian Norris, Richard Weinberger, David Woodhouse,
	Vladimir Zapolskiy, linux-arm-kernel

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

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

* [PATCH 14/22] mtd: nand: mediatek: return error code of nand_scan_ident/tail() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (12 preceding siblings ...)
  2016-11-04 10:43 ` [PATCH 13/22] mtd: nand: lpc32xx: " Masahiro Yamada
@ 2016-11-04 10:43 ` Masahiro Yamada
  2016-11-04 10:43 ` [PATCH 15/22] mtd: nand: mxc: " Masahiro Yamada
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:43 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-arm-kernel, linux-kernel, Boris Brezillon,
	Brian Norris, Richard Weinberger, David Woodhouse,
	linux-mediatek, Matthias Brugger

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

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

* [PATCH 15/22] mtd: nand: mxc: return error code of nand_scan_ident/tail() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (13 preceding siblings ...)
  2016-11-04 10:43 ` [PATCH 14/22] mtd: nand: mediatek: " Masahiro Yamada
@ 2016-11-04 10:43 ` Masahiro Yamada
  2016-11-04 10:43 ` [PATCH 16/22] mtd: nand: omap2: " Masahiro Yamada
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:43 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse

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

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

* [PATCH 16/22] mtd: nand: omap2: return error code of nand_scan_ident/tail() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (14 preceding siblings ...)
  2016-11-04 10:43 ` [PATCH 15/22] mtd: nand: mxc: " Masahiro Yamada
@ 2016-11-04 10:43 ` Masahiro Yamada
  2016-11-04 10:43 ` [PATCH 17/22] mtd: nand: vf610: " Masahiro Yamada
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:43 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse

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

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

* [PATCH 17/22] mtd: nand: vf610: return error code of nand_scan_ident/tail() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (15 preceding siblings ...)
  2016-11-04 10:43 ` [PATCH 16/22] mtd: nand: omap2: " Masahiro Yamada
@ 2016-11-04 10:43 ` Masahiro Yamada
  2016-11-04 10:43 ` [PATCH 18/22] mtd: nand: cafe: return error code of nand_scan_ident() " Masahiro Yamada
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:43 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, Brian Norris, linux-kernel, Boris Brezillon,
	Stefan Agner, Richard Weinberger, David Woodhouse

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

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

* [PATCH 18/22] mtd: nand: cafe: return error code of nand_scan_ident() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (16 preceding siblings ...)
  2016-11-04 10:43 ` [PATCH 17/22] mtd: nand: vf610: " Masahiro Yamada
@ 2016-11-04 10:43 ` Masahiro Yamada
  2016-11-04 10:43 ` [PATCH 19/22] mtd: nand: hisi504: " Masahiro Yamada
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:43 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse

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

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

* [PATCH 19/22] mtd: nand: hisi504: return error code of nand_scan_ident() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (17 preceding siblings ...)
  2016-11-04 10:43 ` [PATCH 18/22] mtd: nand: cafe: return error code of nand_scan_ident() " Masahiro Yamada
@ 2016-11-04 10:43 ` Masahiro Yamada
  2016-11-04 10:43 ` [PATCH 20/22] mtd: nand: pxa3xx: " Masahiro Yamada
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:43 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse

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

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

* [PATCH 20/22] mtd: nand: pxa3xx: return error code of nand_scan_ident() on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (18 preceding siblings ...)
  2016-11-04 10:43 ` [PATCH 19/22] mtd: nand: hisi504: " Masahiro Yamada
@ 2016-11-04 10:43 ` Masahiro Yamada
  2016-11-04 10:43 ` [PATCH 21/22] mtd: nand: nandsim: remove unneeded checks for nand_scan_ident/tail() Masahiro Yamada
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:43 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse, Ezequiel Garcia

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

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

* [PATCH 21/22] mtd: nand: nandsim: remove unneeded checks for nand_scan_ident/tail()
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (19 preceding siblings ...)
  2016-11-04 10:43 ` [PATCH 20/22] mtd: nand: pxa3xx: " Masahiro Yamada
@ 2016-11-04 10:43 ` Masahiro Yamada
  2016-11-04 10:43 ` [PATCH 22/22] mtd: nand: socrates: use nand_scan() for nand_scan_ident/tail() combo Masahiro Yamada
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:43 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse

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

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

* [PATCH 22/22] mtd: nand: socrates: use nand_scan() for nand_scan_ident/tail() combo
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (20 preceding siblings ...)
  2016-11-04 10:43 ` [PATCH 21/22] mtd: nand: nandsim: remove unneeded checks for nand_scan_ident/tail() Masahiro Yamada
@ 2016-11-04 10:43 ` Masahiro Yamada
  2016-11-05  7:34 ` [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident, _tail) on error Marek Vasut
  2016-11-06 22:55 ` [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) " Boris Brezillon
  23 siblings, 0 replies; 28+ messages in thread
From: Masahiro Yamada @ 2016-11-04 10:43 UTC (permalink / raw)
  To: linux-mtd
  Cc: Masahiro Yamada, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse

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

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

* Re: [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident, _tail) on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (21 preceding siblings ...)
  2016-11-04 10:43 ` [PATCH 22/22] mtd: nand: socrates: use nand_scan() for nand_scan_ident/tail() combo Masahiro Yamada
@ 2016-11-05  7:34 ` Marek Vasut
  2016-11-06 22:55 ` [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) " Boris Brezillon
  23 siblings, 0 replies; 28+ messages in thread
From: Marek Vasut @ 2016-11-05  7:34 UTC (permalink / raw)
  To: Masahiro Yamada, linux-mtd
  Cc: Boris Brezillon, Richard Weinberger, Kamal Dasu, Josh Wu,
	linuxppc-dev, linux-kernel, Stefan Agner, Vladimir Zapolskiy,
	Wenyou Yang, linux-mediatek, Ezequiel Garcia, Sylvain Lemieux,
	Matthias Brugger, bcm-kernel-feedback-list, Brian Norris,
	David Woodhouse, linux-arm-kernel

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 <marek.vasut@gmail.com>

Nice cleanup, thanks!

-- 
Best regards,
Marek Vasut

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

* Re: [PATCH 13/22] mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on error
  2016-11-04 10:43 ` [PATCH 13/22] mtd: nand: lpc32xx: " Masahiro Yamada
@ 2016-11-06  1:37   ` Vladimir Zapolskiy
  2016-11-06 18:27   ` Boris Brezillon
  1 sibling, 0 replies; 28+ messages in thread
From: Vladimir Zapolskiy @ 2016-11-06  1:37 UTC (permalink / raw)
  To: Masahiro Yamada, linux-mtd
  Cc: Sylvain Lemieux, linux-kernel, Boris Brezillon, Brian Norris,
	Richard Weinberger, David Woodhouse, linux-arm-kernel

On 11/04/2016 12:43 PM, Masahiro Yamada wrote:
> 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>
> ---

Acked-by: Vladimir Zapolskiy <vz@mleia.com>

Thank you for the change.

--
With best wishes,
Vladimir

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

* Re: [PATCH 13/22] mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on error
  2016-11-04 10:43 ` [PATCH 13/22] mtd: nand: lpc32xx: " Masahiro Yamada
  2016-11-06  1:37   ` Vladimir Zapolskiy
@ 2016-11-06 18:27   ` Boris Brezillon
  2016-11-07  0:30     ` Vladimir Zapolskiy
  1 sibling, 1 reply; 28+ messages in thread
From: Boris Brezillon @ 2016-11-06 18:27 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-mtd, Sylvain Lemieux, linux-kernel, Brian Norris,
	Richard Weinberger, David Woodhouse, Vladimir Zapolskiy,
	linux-arm-kernel

On Fri,  4 Nov 2016 19:43:01 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:

> 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);

You miss

	if (res)

here.

No need to resend, I'll fix it when applying the patches.

>  		goto err_exit3;
> -	}
>  
>  	mtd->name = "nxp_lpc3220_slc";
>  	res = mtd_device_register(mtd, host->ncfg->parts,

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

* Re: [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error
  2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
                   ` (22 preceding siblings ...)
  2016-11-05  7:34 ` [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident, _tail) on error Marek Vasut
@ 2016-11-06 22:55 ` Boris Brezillon
  23 siblings, 0 replies; 28+ messages in thread
From: Boris Brezillon @ 2016-11-06 22:55 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-mtd, Sylvain Lemieux, Josh Wu, Matthias Brugger,
	Stefan Agner, Vladimir Zapolskiy, linux-mediatek, linux-kernel,
	Brian Norris, Ezequiel Garcia, Richard Weinberger,
	David Woodhouse, Kamal Dasu, bcm-kernel-feedback-list,
	linuxppc-dev, Wenyou Yang, linux-arm-kernel

On Fri,  4 Nov 2016 19:42:48 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> 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(-)
> 

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

* Re: [PATCH 13/22] mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on error
  2016-11-06 18:27   ` Boris Brezillon
@ 2016-11-07  0:30     ` Vladimir Zapolskiy
  0 siblings, 0 replies; 28+ messages in thread
From: Vladimir Zapolskiy @ 2016-11-07  0:30 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Masahiro Yamada, linux-mtd, Sylvain Lemieux, linux-kernel,
	Brian Norris, Richard Weinberger, David Woodhouse,
	linux-arm-kernel

Hi Boris,

On 11/06/2016 08:27 PM, Boris Brezillon wrote:
> On Fri,  4 Nov 2016 19:43:01 +0900
> Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>
>> 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>
>> ---

[snip]

>> -	if (nand_scan_tail(mtd)) {
>> -		res = -ENXIO;
>> +	res = nand_scan_tail(mtd);
>
> You miss
>
> 	if (res)
>
> here.
>
> No need to resend, I'll fix it when applying the patches.
>
>>  		goto err_exit3;
>> -	}
>>

nice catch, thank you for noticing and fixing the overlooked bug!

--
With best wishes,
Vladimir

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

end of thread, other threads:[~2016-11-07  0:30 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-04 10:42 [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error Masahiro Yamada
2016-11-04 10:42 ` [PATCH 01/22] mtd: nand: ams-delta: return error code of nand_scan() " Masahiro Yamada
2016-11-04 10:42 ` [PATCH 02/22] mtd: nand: cmx270: " Masahiro Yamada
2016-11-04 10:42 ` [PATCH 03/22] mtd: nand: cs553x: " Masahiro Yamada
2016-11-04 10:42 ` [PATCH 04/22] mtd: nand: gpio: " Masahiro Yamada
2016-11-04 10:42 ` [PATCH 05/22] mtd: nand: mpc5121: " Masahiro Yamada
2016-11-04 10:42 ` [PATCH 06/22] mtd: nand: tmio: " Masahiro Yamada
2016-11-04 10:42 ` [PATCH 07/22] mtd: nand: orion: " Masahiro Yamada
2016-11-04 10:42 ` [PATCH 08/22] mtd: nand: pasemi: " Masahiro Yamada
2016-11-04 10:42 ` [PATCH 09/22] mtd: nand: plat_nand: " Masahiro Yamada
2016-11-04 10:42 ` [PATCH 10/22] mtd: nand: atmel: return error code of nand_scan_ident/tail() " Masahiro Yamada
2016-11-04 10:42 ` [PATCH 11/22] mtd: nand: brcmnand: " Masahiro Yamada
2016-11-04 10:43 ` [PATCH 12/22] mtd: nand: fsmc: " Masahiro Yamada
2016-11-04 10:43 ` [PATCH 13/22] mtd: nand: lpc32xx: " Masahiro Yamada
2016-11-06  1:37   ` Vladimir Zapolskiy
2016-11-06 18:27   ` Boris Brezillon
2016-11-07  0:30     ` Vladimir Zapolskiy
2016-11-04 10:43 ` [PATCH 14/22] mtd: nand: mediatek: " Masahiro Yamada
2016-11-04 10:43 ` [PATCH 15/22] mtd: nand: mxc: " Masahiro Yamada
2016-11-04 10:43 ` [PATCH 16/22] mtd: nand: omap2: " Masahiro Yamada
2016-11-04 10:43 ` [PATCH 17/22] mtd: nand: vf610: " Masahiro Yamada
2016-11-04 10:43 ` [PATCH 18/22] mtd: nand: cafe: return error code of nand_scan_ident() " Masahiro Yamada
2016-11-04 10:43 ` [PATCH 19/22] mtd: nand: hisi504: " Masahiro Yamada
2016-11-04 10:43 ` [PATCH 20/22] mtd: nand: pxa3xx: " Masahiro Yamada
2016-11-04 10:43 ` [PATCH 21/22] mtd: nand: nandsim: remove unneeded checks for nand_scan_ident/tail() Masahiro Yamada
2016-11-04 10:43 ` [PATCH 22/22] mtd: nand: socrates: use nand_scan() for nand_scan_ident/tail() combo Masahiro Yamada
2016-11-05  7:34 ` [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident, _tail) on error Marek Vasut
2016-11-06 22:55 ` [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) " Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).