diff options
author | Shmulik Ladkani <shmulik.ladkani@gmail.com> | 2012-05-09 06:06:35 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-05-14 00:24:40 -0400 |
commit | 5c2ffb11d40dd967eecb45b8570a871746ba124b (patch) | |
tree | 234ae261e6db2eb23303a908e84a66780e807ce3 /drivers/mtd | |
parent | 4fba37aec7e43f7c80a89425cc820622fcf07464 (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')
-rw-r--r-- | drivers/mtd/nand/cafe_nand.c | 4 | ||||
-rw-r--r-- | drivers/mtd/nand/denali.c | 5 | ||||
-rw-r--r-- | drivers/mtd/nand/docg4.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 8 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 19 | ||||
-rw-r--r-- | drivers/mtd/nand/r852.c | 9 |
6 files changed, 17 insertions, 30 deletions
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c index 3a6c88d69bc7..41371ba1a811 100644 --- a/drivers/mtd/nand/cafe_nand.c +++ b/drivers/mtd/nand/cafe_nand.c | |||
@@ -364,11 +364,11 @@ static int cafe_nand_write_oob(struct mtd_info *mtd, | |||
364 | 364 | ||
365 | /* Don't use -- use nand_read_oob_std for now */ | 365 | /* Don't use -- use nand_read_oob_std for now */ |
366 | static int cafe_nand_read_oob(struct mtd_info *mtd, struct nand_chip *chip, | 366 | static int cafe_nand_read_oob(struct mtd_info *mtd, struct nand_chip *chip, |
367 | int page, int sndcmd) | 367 | int page) |
368 | { | 368 | { |
369 | chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); | 369 | chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); |
370 | chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); | 370 | chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); |
371 | return 1; | 371 | return 0; |
372 | } | 372 | } |
373 | /** | 373 | /** |
374 | * cafe_nand_read_page_syndrome - [REPLACEABLE] hardware ecc syndrome based page read | 374 | * cafe_nand_read_page_syndrome - [REPLACEABLE] hardware ecc syndrome based page read |
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index a54c18611945..0650aafa0dd2 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c | |||
@@ -1113,12 +1113,11 @@ static int denali_write_oob(struct mtd_info *mtd, struct nand_chip *chip, | |||
1113 | } | 1113 | } |
1114 | 1114 | ||
1115 | static int denali_read_oob(struct mtd_info *mtd, struct nand_chip *chip, | 1115 | static int denali_read_oob(struct mtd_info *mtd, struct nand_chip *chip, |
1116 | int page, int sndcmd) | 1116 | int page) |
1117 | { | 1117 | { |
1118 | read_oob_data(mtd, chip->oob_poi, page); | 1118 | read_oob_data(mtd, chip->oob_poi, page); |
1119 | 1119 | ||
1120 | return 0; /* notify NAND core to send command to | 1120 | return 0; |
1121 | NAND device. */ | ||
1122 | } | 1121 | } |
1123 | 1122 | ||
1124 | static int denali_read_page(struct mtd_info *mtd, struct nand_chip *chip, | 1123 | static int denali_read_page(struct mtd_info *mtd, struct nand_chip *chip, |
diff --git a/drivers/mtd/nand/docg4.c b/drivers/mtd/nand/docg4.c index 1f8485d7500c..a225e49a5623 100644 --- a/drivers/mtd/nand/docg4.c +++ b/drivers/mtd/nand/docg4.c | |||
@@ -799,7 +799,7 @@ static int docg4_read_page(struct mtd_info *mtd, struct nand_chip *nand, | |||
799 | } | 799 | } |
800 | 800 | ||
801 | static int docg4_read_oob(struct mtd_info *mtd, struct nand_chip *nand, | 801 | static int docg4_read_oob(struct mtd_info *mtd, struct nand_chip *nand, |
802 | int page, int sndcmd) | 802 | int page) |
803 | { | 803 | { |
804 | struct docg4_priv *doc = nand->priv; | 804 | struct docg4_priv *doc = nand->priv; |
805 | void __iomem *docptr = doc->virtadr; | 805 | void __iomem *docptr = doc->virtadr; |
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index 519e4306e352..95f2af848ff0 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c | |||
@@ -1061,7 +1061,7 @@ exit_auxiliary: | |||
1061 | * this driver. | 1061 | * this driver. |
1062 | */ | 1062 | */ |
1063 | static int gpmi_ecc_read_oob(struct mtd_info *mtd, struct nand_chip *chip, | 1063 | static int gpmi_ecc_read_oob(struct mtd_info *mtd, struct nand_chip *chip, |
1064 | int page, int sndcmd) | 1064 | int page) |
1065 | { | 1065 | { |
1066 | struct gpmi_nand_data *this = chip->priv; | 1066 | struct gpmi_nand_data *this = chip->priv; |
1067 | 1067 | ||
@@ -1084,11 +1084,7 @@ static int gpmi_ecc_read_oob(struct mtd_info *mtd, struct nand_chip *chip, | |||
1084 | chip->oob_poi[0] = chip->read_byte(mtd); | 1084 | chip->oob_poi[0] = chip->read_byte(mtd); |
1085 | } | 1085 | } |
1086 | 1086 | ||
1087 | /* | 1087 | return 0; |
1088 | * Return true, indicating that the next call to this function must send | ||
1089 | * a command. | ||
1090 | */ | ||
1091 | return true; | ||
1092 | } | 1088 | } |
1093 | 1089 | ||
1094 | static int | 1090 | static int |
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 | */ |
1650 | static int nand_read_oob_std(struct mtd_info *mtd, struct nand_chip *chip, | 1649 | static 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 | */ |
1669 | static int nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip, | 1664 | static 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); |
diff --git a/drivers/mtd/nand/r852.c b/drivers/mtd/nand/r852.c index 859ef318e5dc..8cb627751c9c 100644 --- a/drivers/mtd/nand/r852.c +++ b/drivers/mtd/nand/r852.c | |||
@@ -539,14 +539,11 @@ exit: | |||
539 | * nand_read_oob_syndrome assumes we can send column address - we can't | 539 | * nand_read_oob_syndrome assumes we can send column address - we can't |
540 | */ | 540 | */ |
541 | static int r852_read_oob(struct mtd_info *mtd, struct nand_chip *chip, | 541 | static int r852_read_oob(struct mtd_info *mtd, struct nand_chip *chip, |
542 | int page, int sndcmd) | 542 | int page) |
543 | { | 543 | { |
544 | if (sndcmd) { | 544 | chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); |
545 | chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); | ||
546 | sndcmd = 0; | ||
547 | } | ||
548 | chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); | 545 | chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); |
549 | return sndcmd; | 546 | return 0; |
550 | } | 547 | } |
551 | 548 | ||
552 | /* | 549 | /* |