Commit 5f68fb7e authored by Rob Herring (Arm)'s avatar Rob Herring (Arm) Committed by Miquel Raynal
Browse files

mtd: rawnand: atmel: Defer probe if SRAM is missing



The Atmel NAND controller driver depends on an SRAM pool and has an
implicit assumption that the SRAM pool has already been created.
Changing the initcall ordering can break this. Unfortunately, fw_devlink
can't save us here as there's not a standard property to track the
dependency. So it's up to deferring probe to save us.

Acked-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Tested-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: default avatarRob Herring (Arm) <robh@kernel.org>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent aa8cb72c
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -2304,10 +2304,8 @@ atmel_hsmc_nand_controller_init(struct atmel_hsmc_nand_controller *nc)

	nc->sram.pool = of_gen_pool_get(nc->base.dev->of_node,
					 "atmel,nfc-sram", 0);
	if (!nc->sram.pool) {
		dev_err(nc->base.dev, "Missing SRAM\n");
		return -ENOMEM;
	}
	if (!nc->sram.pool)
		return dev_err_probe(nc->base.dev, -EPROBE_DEFER, "Missing SRAM\n");

	nc->sram.virt = (void __iomem *)gen_pool_dma_alloc(nc->sram.pool,
							   ATMEL_NFC_SRAM_SIZE,