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>
This commit is contained in:
Shmulik Ladkani 2012-05-09 13:06:35 +03:00 committed by David Woodhouse
parent 4fba37aec7
commit 5c2ffb11d4
7 changed files with 19 additions and 33 deletions

View File

@ -364,11 +364,11 @@ static int cafe_nand_write_oob(struct mtd_info *mtd,
/* Don't use -- use nand_read_oob_std for now */ /* Don't use -- use nand_read_oob_std for now */
static int cafe_nand_read_oob(struct mtd_info *mtd, struct nand_chip *chip, static int cafe_nand_read_oob(struct mtd_info *mtd, struct nand_chip *chip,
int page, int sndcmd) int page)
{ {
chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
return 1; return 0;
} }
/** /**
* cafe_nand_read_page_syndrome - [REPLACEABLE] hardware ecc syndrome based page read * cafe_nand_read_page_syndrome - [REPLACEABLE] hardware ecc syndrome based page read

View File

@ -1113,12 +1113,11 @@ static int denali_write_oob(struct mtd_info *mtd, struct nand_chip *chip,
} }
static int denali_read_oob(struct mtd_info *mtd, struct nand_chip *chip, static int denali_read_oob(struct mtd_info *mtd, struct nand_chip *chip,
int page, int sndcmd) int page)
{ {
read_oob_data(mtd, chip->oob_poi, page); read_oob_data(mtd, chip->oob_poi, page);
return 0; /* notify NAND core to send command to return 0;
NAND device. */
} }
static int denali_read_page(struct mtd_info *mtd, struct nand_chip *chip, static int denali_read_page(struct mtd_info *mtd, struct nand_chip *chip,

View File

@ -799,7 +799,7 @@ static int docg4_read_page(struct mtd_info *mtd, struct nand_chip *nand,
} }
static int docg4_read_oob(struct mtd_info *mtd, struct nand_chip *nand, static int docg4_read_oob(struct mtd_info *mtd, struct nand_chip *nand,
int page, int sndcmd) int page)
{ {
struct docg4_priv *doc = nand->priv; struct docg4_priv *doc = nand->priv;
void __iomem *docptr = doc->virtadr; void __iomem *docptr = doc->virtadr;

View File

@ -1061,7 +1061,7 @@ exit_auxiliary:
* this driver. * this driver.
*/ */
static int gpmi_ecc_read_oob(struct mtd_info *mtd, struct nand_chip *chip, static int gpmi_ecc_read_oob(struct mtd_info *mtd, struct nand_chip *chip,
int page, int sndcmd) int page)
{ {
struct gpmi_nand_data *this = chip->priv; struct gpmi_nand_data *this = chip->priv;
@ -1084,11 +1084,7 @@ static int gpmi_ecc_read_oob(struct mtd_info *mtd, struct nand_chip *chip,
chip->oob_poi[0] = chip->read_byte(mtd); chip->oob_poi[0] = chip->read_byte(mtd);
} }
/* return 0;
* Return true, indicating that the next call to this function must send
* a command.
*/
return true;
} }
static int static int

View File

@ -1645,17 +1645,13 @@ static int nand_read(struct mtd_info *mtd, loff_t from, size_t len,
* @mtd: mtd info structure * @mtd: mtd info structure
* @chip: nand chip info structure * @chip: nand chip info structure
* @page: page number to read * @page: page number to read
* @sndcmd: flag whether to issue read command or not
*/ */
static int nand_read_oob_std(struct mtd_info *mtd, struct nand_chip *chip, static int nand_read_oob_std(struct mtd_info *mtd, struct nand_chip *chip,
int page, int sndcmd) int page)
{ {
if (sndcmd) {
chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
sndcmd = 0;
}
chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
return sndcmd; return 0;
} }
/** /**
@ -1664,10 +1660,9 @@ static int nand_read_oob_std(struct mtd_info *mtd, struct nand_chip *chip,
* @mtd: mtd info structure * @mtd: mtd info structure
* @chip: nand chip info structure * @chip: nand chip info structure
* @page: page number to read * @page: page number to read
* @sndcmd: flag whether to issue read command or not
*/ */
static int nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip, static int nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
int page, int sndcmd) int page)
{ {
uint8_t *buf = chip->oob_poi; uint8_t *buf = chip->oob_poi;
int length = mtd->oobsize; int length = mtd->oobsize;
@ -1694,7 +1689,7 @@ static int nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
if (length > 0) if (length > 0)
chip->read_buf(mtd, bufpoi, length); chip->read_buf(mtd, bufpoi, length);
return 1; return 0;
} }
/** /**
@ -1831,9 +1826,9 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
while (1) { while (1) {
if (ops->mode == MTD_OPS_RAW) if (ops->mode == MTD_OPS_RAW)
chip->ecc.read_oob_raw(mtd, chip, page, 1); chip->ecc.read_oob_raw(mtd, chip, page);
else else
chip->ecc.read_oob(mtd, chip, page, 1); chip->ecc.read_oob(mtd, chip, page);
len = min(len, readlen); len = min(len, readlen);
buf = nand_transfer_oob(chip, buf, ops, len); buf = nand_transfer_oob(chip, buf, ops, len);

View File

@ -539,14 +539,11 @@ exit:
* nand_read_oob_syndrome assumes we can send column address - we can't * nand_read_oob_syndrome assumes we can send column address - we can't
*/ */
static int r852_read_oob(struct mtd_info *mtd, struct nand_chip *chip, static int r852_read_oob(struct mtd_info *mtd, struct nand_chip *chip,
int page, int sndcmd) int page)
{ {
if (sndcmd) {
chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
sndcmd = 0;
}
chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
return sndcmd; return 0;
} }
/* /*

View File

@ -372,9 +372,8 @@ struct nand_ecc_ctrl {
int (*write_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip, int (*write_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip,
int page); int page);
int (*read_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip, int (*read_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip,
int page, int sndcmd); int page);
int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page, int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page);
int sndcmd);
int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip, int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip,
int page); int page);
}; };