Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad71148c authored by Boris Brezillon's avatar Boris Brezillon Committed by Miquel Raynal
Browse files

mtd: rawnand: fsmc: Stop using the dummy controller obj



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: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 1e809f7e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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;