]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mtd: rawnand: ams-delta: Explicitly inherit from nand_controller
authorBoris Brezillon <boris.brezillon@bootlin.com>
Sun, 11 Nov 2018 07:55:13 +0000 (08:55 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 7 Dec 2018 09:38:25 +0000 (10:38 +0100)
All NAND objects are supposed to inherit from nand_controller. The
framework is providing a dummy controller object, but we're moving
away from this approach in favor of explicit inheritance.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Tested-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/ams-delta.c

index c59672a928322d1e566384e4f09b07f8cbdb73ac..34b83edb965cadf69e2dfed2d0bcde81d3d93133 100644 (file)
@@ -29,6 +29,7 @@
  * MTD structure for E3 (Delta)
  */
 struct ams_delta_nand {
+       struct nand_controller  base;
        struct nand_chip        nand_chip;
        struct gpio_desc        *gpiod_rdy;
        struct gpio_desc        *gpiod_nce;
@@ -277,6 +278,10 @@ static int ams_delta_init(struct platform_device *pdev)
        /* Initialize data port direction to a known state */
        ams_delta_dir_input(priv, true);
 
+       /* Initialize the NAND controller object embedded in ams_delta_nand. */
+       nand_controller_init(&priv->base);
+       this->controller = &priv->base;
+
        /* Scan to find existence of the device */
        err = nand_scan(this, 1);
        if (err)