mtd: nand: cafe: return error code of nand_scan_ident() on error
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Fri Dec 16 11:59:08 PST 2016
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=72480e4e9537fe7c8b9ccc980873665676002808
Commit: 72480e4e9537fe7c8b9ccc980873665676002808
Parent: e9d354b4b26aa8fe18b3a6858f2161a43a040e1f
Author: Masahiro Yamada <yamada.masahiro at socionext.com>
AuthorDate: Fri Nov 4 19:43:06 2016 +0900
Committer: Boris Brezillon <boris.brezillon at free-electrons.com>
CommitDate: Mon Nov 7 14:48:51 2016 +0100
mtd: nand: cafe: return error code of nand_scan_ident() on error
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 at socionext.com>
Reviewed-by: Marek Vasut <marek.vasut at gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.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) +
More information about the linux-mtd-cvs
mailing list