aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/nand/denali.c7
-rw-r--r--drivers/mtd/nand/docg4.c6
-rw-r--r--drivers/mtd/nand/nand_base.c14
-rw-r--r--include/linux/mtd/nand.h5
4 files changed, 16 insertions, 16 deletions
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index c07cd573ad3a..9f2012a3e764 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1233,7 +1233,7 @@ static int denali_waitfunc(struct mtd_info *mtd, struct nand_chip *chip)
1233 return status; 1233 return status;
1234} 1234}
1235 1235
1236static void denali_erase(struct mtd_info *mtd, int page) 1236static int denali_erase(struct mtd_info *mtd, int page)
1237{ 1237{
1238 struct denali_nand_info *denali = mtd_to_denali(mtd); 1238 struct denali_nand_info *denali = mtd_to_denali(mtd);
1239 1239
@@ -1250,8 +1250,7 @@ static void denali_erase(struct mtd_info *mtd, int page)
1250 irq_status = wait_for_irq(denali, INTR_STATUS__ERASE_COMP | 1250 irq_status = wait_for_irq(denali, INTR_STATUS__ERASE_COMP |
1251 INTR_STATUS__ERASE_FAIL); 1251 INTR_STATUS__ERASE_FAIL);
1252 1252
1253 denali->status = (irq_status & INTR_STATUS__ERASE_FAIL) ? 1253 return (irq_status & INTR_STATUS__ERASE_FAIL) ? NAND_STATUS_FAIL : PASS;
1254 NAND_STATUS_FAIL : PASS;
1255} 1254}
1256 1255
1257static void denali_cmdfunc(struct mtd_info *mtd, unsigned int cmd, int col, 1256static void denali_cmdfunc(struct mtd_info *mtd, unsigned int cmd, int col,
@@ -1584,7 +1583,7 @@ int denali_init(struct denali_nand_info *denali)
1584 denali->nand.ecc.write_page_raw = denali_write_page_raw; 1583 denali->nand.ecc.write_page_raw = denali_write_page_raw;
1585 denali->nand.ecc.read_oob = denali_read_oob; 1584 denali->nand.ecc.read_oob = denali_read_oob;
1586 denali->nand.ecc.write_oob = denali_write_oob; 1585 denali->nand.ecc.write_oob = denali_write_oob;
1587 denali->nand.erase_cmd = denali_erase; 1586 denali->nand.erase = denali_erase;
1588 1587
1589 if (nand_scan_tail(&denali->mtd)) { 1588 if (nand_scan_tail(&denali->mtd)) {
1590 ret = -ENXIO; 1589 ret = -ENXIO;
diff --git a/drivers/mtd/nand/docg4.c b/drivers/mtd/nand/docg4.c
index 1b0265e85a06..ce24637e14f1 100644
--- a/drivers/mtd/nand/docg4.c
+++ b/drivers/mtd/nand/docg4.c
@@ -872,7 +872,7 @@ static int docg4_read_oob(struct mtd_info *mtd, struct nand_chip *nand,
872 return 0; 872 return 0;
873} 873}
874 874
875static void docg4_erase_block(struct mtd_info *mtd, int page) 875static int docg4_erase_block(struct mtd_info *mtd, int page)
876{ 876{
877 struct nand_chip *nand = mtd->priv; 877 struct nand_chip *nand = mtd->priv;
878 struct docg4_priv *doc = nand->priv; 878 struct docg4_priv *doc = nand->priv;
@@ -916,6 +916,8 @@ static void docg4_erase_block(struct mtd_info *mtd, int page)
916 write_nop(docptr); 916 write_nop(docptr);
917 poll_status(doc); 917 poll_status(doc);
918 write_nop(docptr); 918 write_nop(docptr);
919
920 return nand->waitfunc(mtd, nand);
919} 921}
920 922
921static int write_page(struct mtd_info *mtd, struct nand_chip *nand, 923static int write_page(struct mtd_info *mtd, struct nand_chip *nand,
@@ -1236,7 +1238,7 @@ static void __init init_mtd_structs(struct mtd_info *mtd)
1236 nand->block_markbad = docg4_block_markbad; 1238 nand->block_markbad = docg4_block_markbad;
1237 nand->read_buf = docg4_read_buf; 1239 nand->read_buf = docg4_read_buf;
1238 nand->write_buf = docg4_write_buf16; 1240 nand->write_buf = docg4_write_buf16;
1239 nand->erase_cmd = docg4_erase_block; 1241 nand->erase = docg4_erase_block;
1240 nand->ecc.read_page = docg4_read_page; 1242 nand->ecc.read_page = docg4_read_page;
1241 nand->ecc.write_page = docg4_write_page; 1243 nand->ecc.write_page = docg4_write_page;
1242 nand->ecc.read_page_raw = docg4_read_page_raw; 1244 nand->ecc.read_page_raw = docg4_read_page_raw;
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index f6c5685b79a6..7853b9b0a05e 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2617,18 +2617,20 @@ out:
2617} 2617}
2618 2618
2619/** 2619/**
2620 * single_erase_cmd - [GENERIC] NAND standard block erase command function 2620 * single_erase - [GENERIC] NAND standard block erase command function
2621 * @mtd: MTD device structure 2621 * @mtd: MTD device structure
2622 * @page: the page address of the block which will be erased 2622 * @page: the page address of the block which will be erased
2623 * 2623 *
2624 * Standard erase command for NAND chips. 2624 * Standard erase command for NAND chips. Returns NAND status.
2625 */ 2625 */
2626static void single_erase_cmd(struct mtd_info *mtd, int page) 2626static int single_erase(struct mtd_info *mtd, int page)
2627{ 2627{
2628 struct nand_chip *chip = mtd->priv; 2628 struct nand_chip *chip = mtd->priv;
2629 /* Send commands to erase a block */ 2629 /* Send commands to erase a block */
2630 chip->cmdfunc(mtd, NAND_CMD_ERASE1, -1, page); 2630 chip->cmdfunc(mtd, NAND_CMD_ERASE1, -1, page);
2631 chip->cmdfunc(mtd, NAND_CMD_ERASE2, -1, -1); 2631 chip->cmdfunc(mtd, NAND_CMD_ERASE2, -1, -1);
2632
2633 return chip->waitfunc(mtd, chip);
2632} 2634}
2633 2635
2634/** 2636/**
@@ -2709,9 +2711,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
2709 (page + pages_per_block)) 2711 (page + pages_per_block))
2710 chip->pagebuf = -1; 2712 chip->pagebuf = -1;
2711 2713
2712 chip->erase_cmd(mtd, page & chip->pagemask); 2714 status = chip->erase(mtd, page & chip->pagemask);
2713
2714 status = chip->waitfunc(mtd, chip);
2715 2715
2716 /* 2716 /*
2717 * See if operation failed and additional status checks are 2717 * See if operation failed and additional status checks are
@@ -3684,7 +3684,7 @@ ident_done:
3684 } 3684 }
3685 3685
3686 chip->badblockbits = 8; 3686 chip->badblockbits = 8;
3687 chip->erase_cmd = single_erase_cmd; 3687 chip->erase = single_erase;
3688 3688
3689 /* Do not replace user supplied command function! */ 3689 /* Do not replace user supplied command function! */
3690 if (mtd->writesize > 512 && chip->cmdfunc == nand_command) 3690 if (mtd->writesize > 512 && chip->cmdfunc == nand_command)
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 450d61ec7f06..7a922e6c4e4b 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -552,8 +552,7 @@ struct nand_buffers {
552 * @ecc: [BOARDSPECIFIC] ECC control structure 552 * @ecc: [BOARDSPECIFIC] ECC control structure
553 * @buffers: buffer structure for read/write 553 * @buffers: buffer structure for read/write
554 * @hwcontrol: platform-specific hardware control structure 554 * @hwcontrol: platform-specific hardware control structure
555 * @erase_cmd: [INTERN] erase command write function, selectable due 555 * @erase: [REPLACEABLE] erase function
556 * to AND support.
557 * @scan_bbt: [REPLACEABLE] function to scan bad block table 556 * @scan_bbt: [REPLACEABLE] function to scan bad block table
558 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transferring 557 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transferring
559 * data from array to read regs (tR). 558 * data from array to read regs (tR).
@@ -637,7 +636,7 @@ struct nand_chip {
637 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, 636 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column,
638 int page_addr); 637 int page_addr);
639 int(*waitfunc)(struct mtd_info *mtd, struct nand_chip *this); 638 int(*waitfunc)(struct mtd_info *mtd, struct nand_chip *this);
640 void (*erase_cmd)(struct mtd_info *mtd, int page); 639 int (*erase)(struct mtd_info *mtd, int page);
641 int (*scan_bbt)(struct mtd_info *mtd); 640 int (*scan_bbt)(struct mtd_info *mtd);
642 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, 641 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state,
643 int status, int page); 642 int status, int page);