aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2014-05-06 19:02:19 -0400
committerBrian Norris <computersforpeace@gmail.com>2014-05-09 16:19:42 -0400
commit49c50b97b5522a987b80fbbf9d9869deee8d23b0 (patch)
treeeb938dffa64256c423dce3dc2e5ff851a0111fbc /include/linux/mtd
parent35fc51956b53eb52f7c4c78aa6157381196cd5ce (diff)
mtd: nand: refactor erase_cmd() to return chip status
The nand_chip::erase_cmd callback previously served a dual purpose; for one, it allowed a per-flash-chip override, so that AG-AND devices could use a different erase command than other NAND. These AND devices were dropped in commit 14c6578683367b1e7af0c3c09e872b45a45183a7 (mtd: nand: remove AG-AND support). On the other hand, some drivers (denali and doc-g4) need to use this sort of callback to implement controller-specific erase operations. To make the latter operation easier for some drivers (e.g., ST's new BCH NAND driver), it helps if the command dispatch and wait functions can be lumped together, rather than called separately. This patch does two things: 1. Pull the call to chip->waitfunc() into chip->erase_cmd(), and return the status from this callback 2. Rename erase_cmd() to just erase(), since this callback does a little more than just send a command Signed-off-by: Brian Norris <computersforpeace@gmail.com> Tested-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/nand.h5
1 files changed, 2 insertions, 3 deletions
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);