summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-11-04 13:42:55 +0300
committerBoris Brezillon <boris.brezillon@free-electrons.com>2016-11-07 16:48:44 +0300
commit6c34ad7d17849bbfaf362d7c5bed11d80c1cdab4 (patch)
tree580b61aff3491f55e85f71fae77f0510c32a3790 /drivers/mtd/nand
parent43358c173d02446b9f8da25fb0de8cfc22eb1ae6 (diff)
downloadlinux-6c34ad7d17849bbfaf362d7c5bed11d80c1cdab4.tar.xz
mtd: nand: orion: return error code of nand_scan() on error
The nand_scan() 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>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/orion_nand.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index 40a7c4a2cf0d..4a91c5d000be 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -155,10 +155,9 @@ static int __init orion_nand_probe(struct platform_device *pdev)
clk_put(clk);
}
- if (nand_scan(mtd, 1)) {
- ret = -ENXIO;
+ ret = nand_scan(mtd, 1);
+ if (ret)
goto no_dev;
- }
mtd->name = "orion_nand";
ret = mtd_device_register(mtd, board->parts, board->nr_parts);