[PATCH v2 11/22] mtd: rawnand: ams-delta: Explicitly inherit from nand_controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
Changes in v2:
- None
---
 drivers/mtd/nand/raw/ams-delta.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c
index ccdd114495bc..723318e25691 100644
--- a/drivers/mtd/nand/raw/ams-delta.c
+++ b/drivers/mtd/nand/raw/ams-delta.c
@@ -27,6 +27,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;
@@ -275,6 +276,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)
-- 
2.17.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux