aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2014-11-10 16:06:04 -0500
committerBrian Norris <computersforpeace@gmail.com>2014-11-26 02:13:38 -0500
commit6710247706bfc4e6ad22a124c097964bb713fb8d (patch)
tree2b4ece87462da36a287fc4d66f3b0fe571149f9e /drivers/mtd
parent3e38933dd894b48d422113cb26fd3510fd2a80bd (diff)
mtd: cafe_nand: drop duplicate .write_page implementation
This write_page() function is functionally equivalent to the default in nand_base.c. Its only difference is in subpage programming support, which cafe_nand.c does not advertise, so the difference is negligible. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/cafe_nand.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
index 4e66726da9aa..9a0f45f1d932 100644
--- a/drivers/mtd/nand/cafe_nand.c
+++ b/drivers/mtd/nand/cafe_nand.c
@@ -529,50 +529,6 @@ static int cafe_nand_write_page_lowlevel(struct mtd_info *mtd,
529 return 0; 529 return 0;
530} 530}
531 531
532static int cafe_nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,
533 uint32_t offset, int data_len, const uint8_t *buf,
534 int oob_required, int page, int cached, int raw)
535{
536 int status;
537
538 chip->cmdfunc(mtd, NAND_CMD_SEQIN, 0x00, page);
539
540 if (unlikely(raw))
541 status = chip->ecc.write_page_raw(mtd, chip, buf, oob_required);
542 else
543 status = chip->ecc.write_page(mtd, chip, buf, oob_required);
544
545 if (status < 0)
546 return status;
547
548 /*
549 * Cached progamming disabled for now, Not sure if its worth the
550 * trouble. The speed gain is not very impressive. (2.3->2.6Mib/s)
551 */
552 cached = 0;
553
554 if (!cached || !(chip->options & NAND_CACHEPRG)) {
555
556 chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
557 status = chip->waitfunc(mtd, chip);
558 /*
559 * See if operation failed and additional status checks are
560 * available
561 */
562 if ((status & NAND_STATUS_FAIL) && (chip->errstat))
563 status = chip->errstat(mtd, chip, FL_WRITING, status,
564 page);
565
566 if (status & NAND_STATUS_FAIL)
567 return -EIO;
568 } else {
569 chip->cmdfunc(mtd, NAND_CMD_CACHEDPROG, -1, -1);
570 status = chip->waitfunc(mtd, chip);
571 }
572
573 return 0;
574}
575
576static int cafe_nand_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip) 532static int cafe_nand_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip)
577{ 533{
578 return 0; 534 return 0;
@@ -800,7 +756,6 @@ static int cafe_nand_probe(struct pci_dev *pdev,
800 cafe->nand.ecc.hwctl = (void *)cafe_nand_bug; 756 cafe->nand.ecc.hwctl = (void *)cafe_nand_bug;
801 cafe->nand.ecc.calculate = (void *)cafe_nand_bug; 757 cafe->nand.ecc.calculate = (void *)cafe_nand_bug;
802 cafe->nand.ecc.correct = (void *)cafe_nand_bug; 758 cafe->nand.ecc.correct = (void *)cafe_nand_bug;
803 cafe->nand.write_page = cafe_nand_write_page;
804 cafe->nand.ecc.write_page = cafe_nand_write_page_lowlevel; 759 cafe->nand.ecc.write_page = cafe_nand_write_page_lowlevel;
805 cafe->nand.ecc.write_oob = cafe_nand_write_oob; 760 cafe->nand.ecc.write_oob = cafe_nand_write_oob;
806 cafe->nand.ecc.read_page = cafe_nand_read_page; 761 cafe->nand.ecc.read_page = cafe_nand_read_page;