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>
#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>
/* 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;
}
/*