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

mtd: nand: pxa3xx: 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
133fe8fa c8cae355

+3 -2
+3 -2
drivers/mtd/nand/pxa3xx_nand.c
··· 1680 1680 chip->ecc.strength = pdata->ecc_strength; 1681 1681 chip->ecc.size = pdata->ecc_step_size; 1682 1682 1683 - if (nand_scan_ident(mtd, 1, NULL)) 1684 - return -ENODEV; 1683 + ret = nand_scan_ident(mtd, 1, NULL); 1684 + if (ret) 1685 + return ret; 1685 1686 1686 1687 if (!pdata->keep_config) { 1687 1688 ret = pxa3xx_nand_init(host);