aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2014-01-02 22:01:40 -0500
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 09:57:52 -0400
commit4103472ec2885946e0b64713b4f4efdb3c091740 (patch)
tree95a4efd108f6dd723194144bb145da17b6df0e61
parent3263fabdabc4b63ea8dc85fa7b6802a05e6de1fa (diff)
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@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r--drivers/mtd/nand/nand_base.c7
-rw-r--r--include/linux/mtd/nand.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 18331c4a8588..357c55d7bbbe 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,
1162 * @data_offs: offset of requested data within the page 1162 * @data_offs: offset of requested data within the page
1163 * @readlen: data length 1163 * @readlen: data length
1164 * @bufpoi: buffer to store read data 1164 * @bufpoi: buffer to store read data
1165 * @page: page number to read
1165 */ 1166 */
1166static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip, 1167static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
1167 uint32_t data_offs, uint32_t readlen, uint8_t *bufpoi) 1168 uint32_t data_offs, uint32_t readlen, uint8_t *bufpoi,
1169 int page)
1168{ 1170{
1169 int start_step, end_step, num_steps; 1171 int start_step, end_step, num_steps;
1170 uint32_t *eccpos = chip->ecc.layout->eccpos; 1172 uint32_t *eccpos = chip->ecc.layout->eccpos;
@@ -1540,7 +1542,8 @@ read_retry:
1540 else if (!aligned && NAND_HAS_SUBPAGE_READ(chip) && 1542 else if (!aligned && NAND_HAS_SUBPAGE_READ(chip) &&
1541 !oob) 1543 !oob)
1542 ret = chip->ecc.read_subpage(mtd, chip, 1544 ret = chip->ecc.read_subpage(mtd, chip,
1543 col, bytes, bufpoi); 1545 col, bytes, bufpoi,
1546 page);
1544 else 1547 else
1545 ret = chip->ecc.read_page(mtd, chip, bufpoi, 1548 ret = chip->ecc.read_page(mtd, chip, bufpoi,
1546 oob_required, page); 1549 oob_required, page);
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index aa005e87d161..0747fef2bfc6 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -488,7 +488,7 @@ struct nand_ecc_ctrl {
488 int (*read_page)(struct mtd_info *mtd, struct nand_chip *chip, 488 int (*read_page)(struct mtd_info *mtd, struct nand_chip *chip,
489 uint8_t *buf, int oob_required, int page); 489 uint8_t *buf, int oob_required, int page);
490 int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip, 490 int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip,
491 uint32_t offs, uint32_t len, uint8_t *buf); 491 uint32_t offs, uint32_t len, uint8_t *buf, int page);
492 int (*write_subpage)(struct mtd_info *mtd, struct nand_chip *chip, 492 int (*write_subpage)(struct mtd_info *mtd, struct nand_chip *chip,
493 uint32_t offset, uint32_t data_len, 493 uint32_t offset, uint32_t data_len,
494 const uint8_t *data_buf, int oob_required); 494 const uint8_t *data_buf, int oob_required);