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

mtd: nand: hisi504: 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 -ENODEV.
(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
c8cae355 72480e4e

+1 -3
+1 -3
drivers/mtd/nand/hisi504_nand.c
··· 774 774 } 775 775 776 776 ret = nand_scan_ident(mtd, max_chips, NULL); 777 - if (ret) { 778 - ret = -ENODEV; 777 + if (ret) 779 778 goto err_res; 780 - } 781 779 782 780 host->buffer = dmam_alloc_coherent(dev, mtd->writesize + mtd->oobsize, 783 781 &host->dma_buffer, GFP_KERNEL);