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

mtd: nand: fsmc: return error code of nand_scan_ident/tail() on error

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>
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
ad5678ec c25cca03

+4 -5
+4 -5
drivers/mtd/nand/fsmc_nand.c
··· 926 926 /* 927 927 * Scan to find existence of the device 928 928 */ 929 - if (nand_scan_ident(mtd, 1, NULL)) { 930 - ret = -ENXIO; 929 + ret = nand_scan_ident(mtd, 1, NULL); 930 + if (ret) { 931 931 dev_err(&pdev->dev, "No NAND Device found!\n"); 932 932 goto err_scan_ident; 933 933 } ··· 992 992 } 993 993 994 994 /* Second stage of scan to fill MTD data-structures */ 995 - if (nand_scan_tail(mtd)) { 996 - ret = -ENXIO; 995 + ret = nand_scan_tail(mtd); 996 + if (ret) 997 997 goto err_probe; 998 - } 999 998 1000 999 /* 1001 1000 * The partition information can is accessed by (in the same precedence)