Skip to content

Commit df66c27

Browse files
bbrezillonmiquelraynal
authored andcommitted
mtd: rawnand: gpio: Get rid of the legacy interface implementation
Now that exec_op() is implemented, we can get rid of the legacy interface implementation. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 22b27a6 commit df66c27

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

drivers/mtd/nand/raw/gpio.c

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -72,34 +72,6 @@ static void gpio_nand_dosync(struct gpiomtd *gpiomtd)
7272
static inline void gpio_nand_dosync(struct gpiomtd *gpiomtd) {}
7373
#endif
7474

75-
static void gpio_nand_cmd_ctrl(struct nand_chip *chip, int cmd,
76-
unsigned int ctrl)
77-
{
78-
struct gpiomtd *gpiomtd = gpio_nand_getpriv(nand_to_mtd(chip));
79-
80-
gpio_nand_dosync(gpiomtd);
81-
82-
if (ctrl & NAND_CTRL_CHANGE) {
83-
if (gpiomtd->nce)
84-
gpiod_set_value(gpiomtd->nce, !(ctrl & NAND_NCE));
85-
gpiod_set_value(gpiomtd->cle, !!(ctrl & NAND_CLE));
86-
gpiod_set_value(gpiomtd->ale, !!(ctrl & NAND_ALE));
87-
gpio_nand_dosync(gpiomtd);
88-
}
89-
if (cmd == NAND_CMD_NONE)
90-
return;
91-
92-
writeb(cmd, gpiomtd->nand_chip.legacy.IO_ADDR_W);
93-
gpio_nand_dosync(gpiomtd);
94-
}
95-
96-
static int gpio_nand_devready(struct nand_chip *chip)
97-
{
98-
struct gpiomtd *gpiomtd = gpio_nand_getpriv(nand_to_mtd(chip));
99-
100-
return gpiod_get_value(gpiomtd->rdy);
101-
}
102-
10375
static int gpio_nand_exec_instr(struct nand_chip *chip,
10476
const struct nand_op_instr *instr)
10577
{
@@ -365,21 +337,14 @@ static int gpio_nand_probe(struct platform_device *pdev)
365337
ret = PTR_ERR(gpiomtd->rdy);
366338
goto out_ce;
367339
}
368-
/* Using RDY pin */
369-
if (gpiomtd->rdy)
370-
chip->legacy.dev_ready = gpio_nand_devready;
371340

372341
nand_controller_init(&gpiomtd->base);
373342
gpiomtd->base.ops = &gpio_nand_ops;
374343

375344
nand_set_flash_node(chip, pdev->dev.of_node);
376-
chip->legacy.IO_ADDR_R = gpiomtd->io;
377-
chip->legacy.IO_ADDR_W = chip->legacy.IO_ADDR_R;
378345
chip->ecc.mode = NAND_ECC_SOFT;
379346
chip->ecc.algo = NAND_ECC_HAMMING;
380347
chip->options = gpiomtd->plat.options;
381-
chip->legacy.chip_delay = gpiomtd->plat.chip_delay;
382-
chip->legacy.cmd_ctrl = gpio_nand_cmd_ctrl;
383348
chip->controller = &gpiomtd->base;
384349

385350
mtd = nand_to_mtd(chip);

0 commit comments

Comments
 (0)