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

mtd: nand: mediatek: 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 -ENODEV.

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
f0dbe4aa b04bafca

+2 -2
+2 -2
drivers/mtd/nand/mtk_nand.c
··· 1297 1297 1298 1298 ret = nand_scan_ident(mtd, nsels, NULL); 1299 1299 if (ret) 1300 - return -ENODEV; 1300 + return ret; 1301 1301 1302 1302 /* store bbt magic in page, cause OOB is not protected */ 1303 1303 if (nand->bbt_options & NAND_BBT_USE_FLASH) ··· 1323 1323 1324 1324 ret = nand_scan_tail(mtd); 1325 1325 if (ret) 1326 - return -ENODEV; 1326 + return ret; 1327 1327 1328 1328 ret = mtd_device_parse_register(mtd, NULL, NULL, NULL, 0); 1329 1329 if (ret) {