public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Boris Brezillon <boris.brezillon@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	linux-mtd@lists.infradead.org
Cc: David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Han Xu <han.xu@nxp.com>, Vladimir Zapolskiy <vz@mleia.com>,
	Sylvain Lemieux <slemieux.tyco@gmail.com>,
	Stefan Agner <stefan@agner.ch>
Subject: [PATCH 04/10] mtd: rawnand: fsmc: Stop using the dummy controller obj
Date: Tue, 20 Nov 2018 10:02:33 +0100	[thread overview]
Message-ID: <20181120090239.5792-5-boris.brezillon@bootlin.com> (raw)
In-Reply-To: <20181120090239.5792-1-boris.brezillon@bootlin.com>

The dummy controller is kept around to support old drivers. Let's
patch this one and declare our own nand_controller instance.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
---
 drivers/mtd/nand/raw/fsmc_nand.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c
index 23d00a2c926f..db5174c336d4 100644
--- a/drivers/mtd/nand/raw/fsmc_nand.c
+++ b/drivers/mtd/nand/raw/fsmc_nand.c
@@ -122,6 +122,7 @@ enum access_mode {
 /**
  * struct fsmc_nand_data - structure for FSMC NAND device state
  *
+ * @base:		Inherit from the nand_controller struct
  * @pid:		Part ID on the AMBA PrimeCell format
  * @nand:		Chip related info for a NAND flash.
  *
@@ -143,6 +144,7 @@ enum access_mode {
  * @regs_va:		Registers base address for a given bank.
  */
 struct fsmc_nand_data {
+	struct nand_controller	base;
 	u32			pid;
 	struct nand_chip	nand;
 
@@ -1117,10 +1119,13 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
 		nand->ecc.strength = 8;
 	}
 
+	nand_controller_init(&host->base);
+	host->base.ops = &fsmc_nand_controller_ops;
+	nand->controller = &host->base;
+
 	/*
 	 * Scan to find existence of the device
 	 */
-	nand->dummy_controller.ops = &fsmc_nand_controller_ops;
 	ret = nand_scan(nand, 1);
 	if (ret)
 		goto release_dma_write_chan;
-- 
2.17.1

  parent reply	other threads:[~2018-11-20  9:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-20  9:02 [PATCH 00/10] mtd: rawnand: 4th batch of cleanups Boris Brezillon
2018-11-20  9:02 ` [PATCH 01/10] mtd: rawnand: fsmc: Stop passing mtd_info objects to internal functions Boris Brezillon
2018-11-20  9:02 ` [PATCH 02/10] mtd: rawnand: fsmc: Fix the fsmc_nand_data kernel-doc Boris Brezillon
2018-11-20  9:02 ` [PATCH 03/10] mtd: rawnand: fsmc: Make conversion from chip to fsmc consistent Boris Brezillon
2018-11-20  9:02 ` Boris Brezillon [this message]
2018-11-20  9:02 ` [PATCH 05/10] mtd: rawnand: fsmc: Add an SPDX tag to replace the license text Boris Brezillon
2018-11-20  9:02 ` [PATCH 06/10] mtd: rawnand: fsmc: Fix all coding style issues reported by checkpatch Boris Brezillon
2018-11-20  9:02 ` [PATCH 07/10] mtd: rawnand: vf610: Stop passing mtd_info to internal functions Boris Brezillon
2018-11-23 23:04   ` Stefan Agner
2018-11-20  9:02 ` [PATCH 08/10] mtd: rawnand: vf610: Stop using the dummy controller obj Boris Brezillon
2018-11-23 23:13   ` Stefan Agner
2018-11-20  9:02 ` [PATCH 09/10] mtd: rawnand: vf610: Add an SPDX tag to replace the license text Boris Brezillon
2018-11-23 23:14   ` Stefan Agner
2018-11-20  9:02 ` [PATCH 10/10] mtd: rawnand: Deprecate the dummy_controller field Boris Brezillon
2018-12-07 18:49 ` [PATCH 00/10] mtd: rawnand: 4th batch of cleanups Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181120090239.5792-5-boris.brezillon@bootlin.com \
    --to=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=han.xu@nxp.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=slemieux.tyco@gmail.com \
    --cc=stefan@agner.ch \
    --cc=vz@mleia.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox