Browse Source

mtd: nand: cs553x: 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>
Masahiro Yamada 8 years ago
parent
commit
29453ba40b
1 changed files with 2 additions and 3 deletions
  1. 2 3
      drivers/mtd/nand/cs553x_nand.c

+ 2 - 3
drivers/mtd/nand/cs553x_nand.c

@@ -242,10 +242,9 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)
 	}
 
 	/* Scan to find existence of the device */
-	if (nand_scan(new_mtd, 1)) {
-		err = -ENXIO;
+	err = nand_scan(new_mtd, 1);
+	if (err)
 		goto out_free;
-	}
 
 	cs553x_mtd[cs] = new_mtd;
 	goto out;