Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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@socionext.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>

authored by

Masahiro Yamada and committed by
Boris Brezillon
72480e4e e9d354b4

+2 -3
+2 -3
drivers/mtd/nand/cafe_nand.c
··· 725 725 usedma = 0; 726 726 727 727 /* Scan to find existence of the device */ 728 - if (nand_scan_ident(mtd, 2, NULL)) { 729 - err = -ENXIO; 728 + err = nand_scan_ident(mtd, 2, NULL); 729 + if (err) 730 730 goto out_irq; 731 - } 732 731 733 732 cafe->dmabuf = dma_alloc_coherent(&cafe->pdev->dev, 734 733 2112 + sizeof(struct nand_buffers) +