]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/mtd/nand/cafe_nand.c
mtd: nand: teach write_page and write_page_raw return an error code
[karo-tx-linux.git] / drivers / mtd / nand / cafe_nand.c
index ac0d967ee3fd175a160f29abe9173e9b76f6c53a..08248a0a167e00e68cde8e7c767cabd0dab8cb12 100644 (file)
@@ -520,7 +520,7 @@ static struct nand_bbt_descr cafe_bbt_mirror_descr_512 = {
 };
 
 
-static void cafe_nand_write_page_lowlevel(struct mtd_info *mtd,
+static int cafe_nand_write_page_lowlevel(struct mtd_info *mtd,
                                          struct nand_chip *chip,
                                          const uint8_t *buf, int oob_required)
 {
@@ -531,6 +531,8 @@ static void cafe_nand_write_page_lowlevel(struct mtd_info *mtd,
 
        /* Set up ECC autogeneration */
        cafe->ctl2 |= (1<<30);
+
+       return 0;
 }
 
 static int cafe_nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,
@@ -542,9 +544,12 @@ static int cafe_nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,
        chip->cmdfunc(mtd, NAND_CMD_SEQIN, 0x00, page);
 
        if (unlikely(raw))
-               chip->ecc.write_page_raw(mtd, chip, buf, oob_required);
+               status = chip->ecc.write_page_raw(mtd, chip, buf, oob_required);
        else
-               chip->ecc.write_page(mtd, chip, buf, oob_required);
+               status = chip->ecc.write_page(mtd, chip, buf, oob_required);
+
+       if (status < 0)
+               return status;
 
        /*
         * Cached progamming disabled for now, Not sure if its worth the