Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310231
b: refs/heads/master
c: 5c2ffb1
h: refs/heads/master
i:
  310229: 3f3b1f0
  310227: 968ba44
  310223: 3df3027
v: v3
  • Loading branch information
Shmulik Ladkani authored and David Woodhouse committed May 14, 2012
1 parent dcf65aa commit 604485e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4fba37aec7e43f7c80a89425cc820622fcf07464
refs/heads/master: 5c2ffb11d40dd967eecb45b8570a871746ba124b
4 changes: 2 additions & 2 deletions trunk/drivers/mtd/nand/cafe_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,11 @@ static int cafe_nand_write_oob(struct mtd_info *mtd,

/* Don't use -- use nand_read_oob_std for now */
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->read_buf(mtd, chip->oob_poi, mtd->oobsize);
return 1;
return 0;
}
/**
* cafe_nand_read_page_syndrome - [REPLACEABLE] hardware ecc syndrome based page read
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/mtd/nand/denali.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
int page, int sndcmd)
int page)
{
read_oob_data(mtd, chip->oob_poi, page);

return 0; /* notify NAND core to send command to
NAND device. */
return 0;
}

static int denali_read_page(struct mtd_info *mtd, struct nand_chip *chip,
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/mtd/nand/docg4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
int page, int sndcmd)
int page)
{
struct docg4_priv *doc = nand->priv;
void __iomem *docptr = doc->virtadr;
Expand Down
8 changes: 2 additions & 6 deletions trunk/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ static void gpmi_ecc_write_page(struct mtd_info *mtd, struct nand_chip *chip,
* this driver.
*/
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;

Expand All @@ -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);
}

/*
* Return true, indicating that the next call to this function must send
* a command.
*/
return true;
return 0;
}

static int
Expand Down
19 changes: 7 additions & 12 deletions trunk/drivers/mtd/nand/nand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1645,17 +1645,13 @@ static int nand_read(struct mtd_info *mtd, loff_t from, size_t len,
* @mtd: mtd info structure
* @chip: nand chip info structure
* @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,
int page, int sndcmd)
int page)
{
if (sndcmd) {
chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
sndcmd = 0;
}
chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
return sndcmd;
return 0;
}

/**
Expand All @@ -1664,10 +1660,9 @@ static int nand_read_oob_std(struct mtd_info *mtd, struct nand_chip *chip,
* @mtd: mtd info structure
* @chip: nand chip info structure
* @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,
int page, int sndcmd)
int page)
{
uint8_t *buf = chip->oob_poi;
int length = mtd->oobsize;
Expand All @@ -1694,7 +1689,7 @@ static int nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
if (length > 0)
chip->read_buf(mtd, bufpoi, length);

return 1;
return 0;
}

/**
Expand Down Expand Up @@ -1831,9 +1826,9 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,

while (1) {
if (ops->mode == MTD_OPS_RAW)
chip->ecc.read_oob_raw(mtd, chip, page, 1);
chip->ecc.read_oob_raw(mtd, chip, page);
else
chip->ecc.read_oob(mtd, chip, page, 1);
chip->ecc.read_oob(mtd, chip, page);

len = min(len, readlen);
buf = nand_transfer_oob(chip, buf, ops, len);
Expand Down
9 changes: 3 additions & 6 deletions trunk/drivers/mtd/nand/r852.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,14 +539,11 @@ int r852_ecc_correct(struct mtd_info *mtd, uint8_t *dat,
* 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,
int page, int sndcmd)
int page)
{
if (sndcmd) {
chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
sndcmd = 0;
}
chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
return sndcmd;
return 0;
}

/*
Expand Down
5 changes: 2 additions & 3 deletions trunk/include/linux/mtd/nand.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,8 @@ struct nand_ecc_ctrl {
int (*write_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip,
int page);
int (*read_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip,
int page, int sndcmd);
int (*read_oob)(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 (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip,
int page);
};
Expand Down

0 comments on commit 604485e

Please sign in to comment.