aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/raw/nandsim.c
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@bootlin.com>2018-09-06 08:05:22 -0400
committerMiquel Raynal <miquel.raynal@bootlin.com>2018-10-03 05:12:25 -0400
commit7e534323c416216e8ac45b5633fb0a5e5137e5b5 (patch)
treec768a726e4ac39da87b976c532146d0eafd4757f /drivers/mtd/nand/raw/nandsim.c
parent767eb6fbdedb7d8b9c7a87d640a8bc8091eba002 (diff)
mtd: rawnand: Pass a nand_chip object to chip->read_xxx() hooks
Let's make the raw NAND API consistent by patching all helpers and hooks to take a nand_chip object instead of an mtd_info one or remove the mtd_info object when both are passed. Let's tackle all chip->read_xxx() hooks at once. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'drivers/mtd/nand/raw/nandsim.c')
-rw-r--r--drivers/mtd/nand/raw/nandsim.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
index e9f7b9e1aead..04feb4e8d112 100644
--- a/drivers/mtd/nand/raw/nandsim.c
+++ b/drivers/mtd/nand/raw/nandsim.c
@@ -1872,9 +1872,8 @@ static void switch_state(struct nandsim *ns)
1872 } 1872 }
1873} 1873}
1874 1874
1875static u_char ns_nand_read_byte(struct mtd_info *mtd) 1875static u_char ns_nand_read_byte(struct nand_chip *chip)
1876{ 1876{
1877 struct nand_chip *chip = mtd_to_nand(mtd);
1878 struct nandsim *ns = nand_get_controller_data(chip); 1877 struct nandsim *ns = nand_get_controller_data(chip);
1879 u_char outb = 0x00; 1878 u_char outb = 0x00;
1880 1879
@@ -2136,9 +2135,8 @@ static void ns_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
2136 } 2135 }
2137} 2136}
2138 2137
2139static void ns_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len) 2138static void ns_nand_read_buf(struct nand_chip *chip, u_char *buf, int len)
2140{ 2139{
2141 struct nand_chip *chip = mtd_to_nand(mtd);
2142 struct nandsim *ns = nand_get_controller_data(chip); 2140 struct nandsim *ns = nand_get_controller_data(chip);
2143 2141
2144 /* Sanity and correctness checks */ 2142 /* Sanity and correctness checks */
@@ -2160,7 +2158,7 @@ static void ns_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
2160 int i; 2158 int i;
2161 2159
2162 for (i = 0; i < len; i++) 2160 for (i = 0; i < len; i++)
2163 buf[i] = mtd_to_nand(mtd)->read_byte(mtd); 2161 buf[i] = chip->read_byte(chip);
2164 2162
2165 return; 2163 return;
2166 } 2164 }