aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_base.c
diff options
context:
space:
mode:
authorShmulik Ladkani <shmulik.ladkani@gmail.com>2012-05-09 06:06:35 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-05-14 00:24:40 -0400
commit5c2ffb11d40dd967eecb45b8570a871746ba124b (patch)
tree234ae261e6db2eb23303a908e84a66780e807ce3 /drivers/mtd/nand/nand_base.c
parent4fba37aec7e43f7c80a89425cc820622fcf07464 (diff)
mtd: nand: remove 'sndcmd' parameter of 'read_oob/read_oob_raw'
As of [mtd: nand: remove autoincrement 'sndcmd' code], the NAND_CMD_READ0 command is issued unconditionally. Thus, read_oob/read_oob_raw's 'sndcmd' argument is no longer needed, as well as their return code. Remove the 'sndcmd' parameter, and set the return code to 0. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r--drivers/mtd/nand/nand_base.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 14e9b32ed8c7..4047d7c2fee6 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1645,17 +1645,13 @@ static int nand_read(struct mtd_info *mtd, loff_t from, size_t len,
1645 * @mtd: mtd info structure 1645 * @mtd: mtd info structure
1646 * @chip: nand chip info structure 1646 * @chip: nand chip info structure
1647 * @page: page number to read 1647 * @page: page number to read
1648 * @sndcmd: flag whether to issue read command or not
1649 */ 1648 */
1650static int nand_read_oob_std(struct mtd_info *mtd, struct nand_chip *chip, 1649static int nand_read_oob_std(struct mtd_info *mtd, struct nand_chip *chip,
1651 int page, int sndcmd) 1650 int page)
1652{ 1651{
1653 if (sndcmd) { 1652 chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
1654 chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
1655 sndcmd = 0;
1656 }
1657 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); 1653 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
1658 return sndcmd; 1654 return 0;
1659} 1655}
1660 1656
1661/** 1657/**
@@ -1664,10 +1660,9 @@ static int nand_read_oob_std(struct mtd_info *mtd, struct nand_chip *chip,
1664 * @mtd: mtd info structure 1660 * @mtd: mtd info structure
1665 * @chip: nand chip info structure 1661 * @chip: nand chip info structure
1666 * @page: page number to read 1662 * @page: page number to read
1667 * @sndcmd: flag whether to issue read command or not
1668 */ 1663 */
1669static int nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip, 1664static int nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
1670 int page, int sndcmd) 1665 int page)
1671{ 1666{
1672 uint8_t *buf = chip->oob_poi; 1667 uint8_t *buf = chip->oob_poi;
1673 int length = mtd->oobsize; 1668 int length = mtd->oobsize;
@@ -1694,7 +1689,7 @@ static int nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
1694 if (length > 0) 1689 if (length > 0)
1695 chip->read_buf(mtd, bufpoi, length); 1690 chip->read_buf(mtd, bufpoi, length);
1696 1691
1697 return 1; 1692 return 0;
1698} 1693}
1699 1694
1700/** 1695/**
@@ -1831,9 +1826,9 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
1831 1826
1832 while (1) { 1827 while (1) {
1833 if (ops->mode == MTD_OPS_RAW) 1828 if (ops->mode == MTD_OPS_RAW)
1834 chip->ecc.read_oob_raw(mtd, chip, page, 1); 1829 chip->ecc.read_oob_raw(mtd, chip, page);
1835 else 1830 else
1836 chip->ecc.read_oob(mtd, chip, page, 1); 1831 chip->ecc.read_oob(mtd, chip, page);
1837 1832
1838 len = min(len, readlen); 1833 len = min(len, readlen);
1839 buf = nand_transfer_oob(chip, buf, ops, len); 1834 buf = nand_transfer_oob(chip, buf, ops, len);