]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
zynq: nand: Fix proper return value for zynq_nand_write_oob
authorJagannadha Sutradharudu Teki <jaganna@xilinx.com>
Fri, 24 May 2013 09:32:59 +0000 (15:02 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 27 May 2013 11:21:21 +0000 (13:21 +0200)
status for waitfunc should verify with NAND_STATUS_FAIL
and return the write_oob value -EIO or 0.

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
drivers/mtd/nand/zynq_nand.c

index 49321631aa6ccf7bbd3628e09e52f6198b092b31..22c975f5116ea3f02d1b6931c914c738b54f9c0e 100644 (file)
@@ -17,6 +17,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <asm/io.h>
+#include <asm/errno.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
@@ -454,10 +455,8 @@ static int zynq_nand_write_oob(struct mtd_info *mtd, struct nand_chip *chip,
        /* Send command to program the OOB data */
        chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
        status = chip->waitfunc(mtd, chip);
-       if (status)
-               return NAND_STATUS_FAIL;
 
-       return status;
+       return status & NAND_STATUS_FAIL ? -EIO : 0;
 }
 
 /*