mtd: nand: add "page" argument for read_subpage hook
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Sat Apr 5 02:59:03 EDT 2014
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=e004debdadf1a661dcd24e2a654e56b0a113e29e
Commit: e004debdadf1a661dcd24e2a654e56b0a113e29e
Parent: bb77082fa2584f0855e614e99b5ffd40b9cf4251
Author: Huang Shijie <b32955 at freescale.com>
AuthorDate: Fri Jan 3 11:01:40 2014 +0800
Committer: Brian Norris <computersforpeace at gmail.com>
CommitDate: Mon Mar 10 22:42:30 2014 -0700
mtd: nand: add "page" argument for read_subpage hook
Add the "page" argument for the read_subpage hook. With this argument,
the implementation of this hook could prints out more accurate information
for debugging.
Signed-off-by: Huang Shijie <b32955 at freescale.com>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
drivers/mtd/nand/nand_base.c | 7 +++++--
include/linux/mtd/nand.h | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 71c5c7a..5826da3 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1162,9 +1162,11 @@ static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
* @data_offs: offset of requested data within the page
* @readlen: data length
* @bufpoi: buffer to store read data
+ * @page: page number to read
*/
static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
- uint32_t data_offs, uint32_t readlen, uint8_t *bufpoi)
+ uint32_t data_offs, uint32_t readlen, uint8_t *bufpoi,
+ int page)
{
int start_step, end_step, num_steps;
uint32_t *eccpos = chip->ecc.layout->eccpos;
@@ -1540,7 +1542,8 @@ read_retry:
else if (!aligned && NAND_HAS_SUBPAGE_READ(chip) &&
!oob)
ret = chip->ecc.read_subpage(mtd, chip,
- col, bytes, bufpoi);
+ col, bytes, bufpoi,
+ page);
else
ret = chip->ecc.read_page(mtd, chip, bufpoi,
oob_required, page);
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index aa005e8..0747fef 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -488,7 +488,7 @@ struct nand_ecc_ctrl {
int (*read_page)(struct mtd_info *mtd, struct nand_chip *chip,
uint8_t *buf, int oob_required, int page);
int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip,
- uint32_t offs, uint32_t len, uint8_t *buf);
+ uint32_t offs, uint32_t len, uint8_t *buf, int page);
int (*write_subpage)(struct mtd_info *mtd, struct nand_chip *chip,
uint32_t offset, uint32_t data_len,
const uint8_t *data_buf, int oob_required);
More information about the linux-mtd-cvs
mailing list