mtd: nand: remove 'sndcmd' parameter of 'read_oob/read_oob_raw'
authorShmulik Ladkani <shmulik.ladkani@gmail.com>
Wed, 9 May 2012 10:06:35 +0000 (13:06 +0300)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 14 May 2012 04:24:40 +0000 (23:24 -0500)
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>
drivers/mtd/nand/cafe_nand.c
drivers/mtd/nand/denali.c
drivers/mtd/nand/docg4.c
drivers/mtd/nand/gpmi-nand/gpmi-nand.c
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/r852.c
include/linux/mtd/nand.h

index 3a6c88d69bc7e82ad389e48ac423b387b57765ae..41371ba1a8117c87aaaf85b63383e60bda6303d6 100644 (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 */
 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
index a54c18611945b09632b09dbeddee25765e43ddaa..0650aafa0dd2238b2af08a1328970e5efb38d24e 100644 (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,
-                          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,
index 1f8485d7500c5274115a529aa7375a7fce7e47cb..a225e49a56235763b35cfd5118f30f7c20c4fb55 100644 (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,
-                         int page, int sndcmd)
+                         int page)
 {
        struct docg4_priv *doc = nand->priv;
        void __iomem *docptr = doc->virtadr;
index 519e4306e352f3b5f24871ba7c8c59b775efd9cb..95f2af848ff0258fd5c7fa7ea10d4ebbe07d3bd9 100644 (file)
@@ -1061,7 +1061,7 @@ exit_auxiliary:
  * 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;
 
@@ -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
index 14e9b32ed8c76236bf55fb3f56ed0499a318fd72..4047d7c2fee64977d1ef0163f4069aad8d3079b9 100644 (file)
@@ -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;
 }
 
 /**
@@ -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;
@@ -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;
 }
 
 /**
@@ -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);
index 859ef318e5dc725ef25952df8fa452b02811dba3..8cb627751c9c9658c5a3d6ac7c0a9cf1f78fb6af 100644 (file)
@@ -539,14 +539,11 @@ exit:
  * 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;
 }
 
 /*
index c7755f455c8161035023c010b50b15cc81d93e7a..57977c6405292347f8026fd23f7bc4572312e345 100644 (file)
@@ -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);
 };