Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Shmulik Ladkani and committed by
David Woodhouse
5c2ffb11 4fba37ae

+19 -33
+2 -2
drivers/mtd/nand/cafe_nand.c
··· 364 364 365 365 /* Don't use -- use nand_read_oob_std for now */ 366 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 369 chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); 370 370 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); 371 - return 1; 371 + return 0; 372 372 } 373 373 /** 374 374 * cafe_nand_read_page_syndrome - [REPLACEABLE] hardware ecc syndrome based page read
+2 -3
drivers/mtd/nand/denali.c
··· 1113 1113 } 1114 1114 1115 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 1118 read_oob_data(mtd, chip->oob_poi, page); 1119 1119 1120 - return 0; /* notify NAND core to send command to 1121 - NAND device. */ 1120 + return 0; 1122 1121 } 1123 1122 1124 1123 static int denali_read_page(struct mtd_info *mtd, struct nand_chip *chip,
+1 -1
drivers/mtd/nand/docg4.c
··· 799 799 } 800 800 801 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 804 struct docg4_priv *doc = nand->priv; 805 805 void __iomem *docptr = doc->virtadr;
+2 -6
drivers/mtd/nand/gpmi-nand/gpmi-nand.c
··· 1061 1061 * this driver. 1062 1062 */ 1063 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 1066 struct gpmi_nand_data *this = chip->priv; 1067 1067 ··· 1084 1084 chip->oob_poi[0] = chip->read_byte(mtd); 1085 1085 } 1086 1086 1087 - /* 1088 - * Return true, indicating that the next call to this function must send 1089 - * a command. 1090 - */ 1091 - return true; 1087 + return 0; 1092 1088 } 1093 1089 1094 1090 static int
+7 -12
drivers/mtd/nand/nand_base.c
··· 1645 1645 * @mtd: mtd info structure 1646 1646 * @chip: nand chip info structure 1647 1647 * @page: page number to read 1648 - * @sndcmd: flag whether to issue read command or not 1649 1648 */ 1650 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) { 1654 - chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); 1655 - sndcmd = 0; 1656 - } 1652 + chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); 1657 1653 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); 1658 - return sndcmd; 1654 + return 0; 1659 1655 } 1660 1656 1661 1657 /** ··· 1660 1664 * @mtd: mtd info structure 1661 1665 * @chip: nand chip info structure 1662 1666 * @page: page number to read 1663 - * @sndcmd: flag whether to issue read command or not 1664 1667 */ 1665 1668 static int nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip, 1666 - int page, int sndcmd) 1669 + int page) 1667 1670 { 1668 1671 uint8_t *buf = chip->oob_poi; 1669 1672 int length = mtd->oobsize; ··· 1689 1694 if (length > 0) 1690 1695 chip->read_buf(mtd, bufpoi, length); 1691 1696 1692 - return 1; 1697 + return 0; 1693 1698 } 1694 1699 1695 1700 /** ··· 1826 1831 1827 1832 while (1) { 1828 1833 if (ops->mode == MTD_OPS_RAW) 1829 - chip->ecc.read_oob_raw(mtd, chip, page, 1); 1834 + chip->ecc.read_oob_raw(mtd, chip, page); 1830 1835 else 1831 - chip->ecc.read_oob(mtd, chip, page, 1); 1836 + chip->ecc.read_oob(mtd, chip, page); 1832 1837 1833 1838 len = min(len, readlen); 1834 1839 buf = nand_transfer_oob(chip, buf, ops, len);
+3 -6
drivers/mtd/nand/r852.c
··· 539 539 * nand_read_oob_syndrome assumes we can send column address - we can't 540 540 */ 541 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) { 545 - chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); 546 - sndcmd = 0; 547 - } 544 + chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); 548 545 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); 549 - return sndcmd; 546 + return 0; 550 547 } 551 548 552 549 /*
+2 -3
include/linux/mtd/nand.h
··· 372 372 int (*write_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip, 373 373 int page); 374 374 int (*read_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip, 375 - int page, int sndcmd); 376 - int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page, 377 - int sndcmd); 375 + int page); 376 + int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page); 378 377 int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip, 379 378 int page); 380 379 };