Skip to content

Commit b4c7196

Browse files
bbrezillonmiquelraynal
authored andcommitted
mtd: rawnand: gpio: Inherit from nand_controller
Inherit from nand_controller so we don't rely on the nand_chip.legacy.dummy_controller field. 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 8fac41e commit b4c7196

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/mtd/nand/raw/gpio.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/of_address.h>
2828

2929
struct gpiomtd {
30+
struct nand_controller base;
3031
void __iomem *io_sync;
3132
struct nand_chip nand_chip;
3233
struct gpio_nand_platdata plat;
@@ -273,13 +274,15 @@ static int gpio_nand_probe(struct platform_device *pdev)
273274
if (gpiomtd->rdy)
274275
chip->legacy.dev_ready = gpio_nand_devready;
275276

277+
nand_controller_init(&gpiomtd->base);
276278
nand_set_flash_node(chip, pdev->dev.of_node);
277279
chip->legacy.IO_ADDR_W = chip->legacy.IO_ADDR_R;
278280
chip->ecc.mode = NAND_ECC_SOFT;
279281
chip->ecc.algo = NAND_ECC_HAMMING;
280282
chip->options = gpiomtd->plat.options;
281283
chip->legacy.chip_delay = gpiomtd->plat.chip_delay;
282284
chip->legacy.cmd_ctrl = gpio_nand_cmd_ctrl;
285+
chip->controller = &gpiomtd->base;
283286

284287
mtd = nand_to_mtd(chip);
285288
mtd->dev.parent = dev;

0 commit comments

Comments
 (0)