mtd: rawnand: toshiba: Pass a single nand_chip object to the status helper
authorMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 24 Sep 2018 09:35:18 +0000 (11:35 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 8 Oct 2018 08:00:10 +0000 (10:00 +0200)
Now that most of the raw NAND API is consistent and has almost all its
helpers and hooks using a single nand_chip object instead of an mtd_info
one (or both), let's do the same cleanup in the raw NAND vendors
drivers.

Apply this change to the Toshiba driver so that the internal helper to
retrieve the ECC status does only take a nand_chip object.

Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
drivers/mtd/nand/raw/nand_toshiba.c

index 941ddc61519065a241117af14fcf23807e59a8ef..d068163b64b3ff1755f5a66d6b3227d627603b93 100644 (file)
@@ -23,9 +23,9 @@
 /* Recommended to rewrite for BENAND */
 #define TOSHIBA_NAND_STATUS_REWRITE_RECOMMENDED        BIT(3)
 
-static int toshiba_nand_benand_eccstatus(struct mtd_info *mtd,
-                                        struct nand_chip *chip)
+static int toshiba_nand_benand_eccstatus(struct nand_chip *chip)
 {
+       struct mtd_info *mtd = nand_to_mtd(chip);
        int ret;
        unsigned int max_bitflips = 0;
        u8 status;
@@ -51,21 +51,19 @@ static int
 toshiba_nand_read_page_benand(struct nand_chip *chip, uint8_t *buf,
                              int oob_required, int page)
 {
-       struct mtd_info *mtd = nand_to_mtd(chip);
        int ret;
 
        ret = nand_read_page_raw(chip, buf, oob_required, page);
        if (ret)
                return ret;
 
-       return toshiba_nand_benand_eccstatus(mtd, chip);
+       return toshiba_nand_benand_eccstatus(chip);
 }
 
 static int
 toshiba_nand_read_subpage_benand(struct nand_chip *chip, uint32_t data_offs,
                                 uint32_t readlen, uint8_t *bufpoi, int page)
 {
-       struct mtd_info *mtd = nand_to_mtd(chip);
        int ret;
 
        ret = nand_read_page_op(chip, page, data_offs,
@@ -73,7 +71,7 @@ toshiba_nand_read_subpage_benand(struct nand_chip *chip, uint32_t data_offs,
        if (ret)
                return ret;
 
-       return toshiba_nand_benand_eccstatus(mtd, chip);
+       return toshiba_nand_benand_eccstatus(chip);
 }
 
 static void toshiba_nand_benand_init(struct nand_chip *chip)