diff options
Diffstat (limited to 'drivers/mtd/nand/cafe_nand.c')
-rw-r--r-- | drivers/mtd/nand/cafe_nand.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c index ac0d967ee3fd..08248a0a167e 100644 --- a/drivers/mtd/nand/cafe_nand.c +++ b/drivers/mtd/nand/cafe_nand.c | |||
@@ -520,7 +520,7 @@ static struct nand_bbt_descr cafe_bbt_mirror_descr_512 = { | |||
520 | }; | 520 | }; |
521 | 521 | ||
522 | 522 | ||
523 | static void cafe_nand_write_page_lowlevel(struct mtd_info *mtd, | 523 | static int cafe_nand_write_page_lowlevel(struct mtd_info *mtd, |
524 | struct nand_chip *chip, | 524 | struct nand_chip *chip, |
525 | const uint8_t *buf, int oob_required) | 525 | const uint8_t *buf, int oob_required) |
526 | { | 526 | { |
@@ -531,6 +531,8 @@ static void cafe_nand_write_page_lowlevel(struct mtd_info *mtd, | |||
531 | 531 | ||
532 | /* Set up ECC autogeneration */ | 532 | /* Set up ECC autogeneration */ |
533 | cafe->ctl2 |= (1<<30); | 533 | cafe->ctl2 |= (1<<30); |
534 | |||
535 | return 0; | ||
534 | } | 536 | } |
535 | 537 | ||
536 | static int cafe_nand_write_page(struct mtd_info *mtd, struct nand_chip *chip, | 538 | 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, | |||
542 | chip->cmdfunc(mtd, NAND_CMD_SEQIN, 0x00, page); | 544 | chip->cmdfunc(mtd, NAND_CMD_SEQIN, 0x00, page); |
543 | 545 | ||
544 | if (unlikely(raw)) | 546 | if (unlikely(raw)) |
545 | chip->ecc.write_page_raw(mtd, chip, buf, oob_required); | 547 | status = chip->ecc.write_page_raw(mtd, chip, buf, oob_required); |
546 | else | 548 | else |
547 | chip->ecc.write_page(mtd, chip, buf, oob_required); | 549 | status = chip->ecc.write_page(mtd, chip, buf, oob_required); |
550 | |||
551 | if (status < 0) | ||
552 | return status; | ||
548 | 553 | ||
549 | /* | 554 | /* |
550 | * Cached progamming disabled for now, Not sure if its worth the | 555 | * Cached progamming disabled for now, Not sure if its worth the |