Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Alexandre Belloni <alexandre.belloni@bootlin.com>
Tested-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

authored by

Rob Herring (Arm) and committed by
Miquel Raynal
5f68fb7e aa8cb72c

+2 -4
+2 -4
drivers/mtd/nand/raw/atmel/nand-controller.c
··· 2304 2304 2305 2305 nc->sram.pool = of_gen_pool_get(nc->base.dev->of_node, 2306 2306 "atmel,nfc-sram", 0); 2307 - if (!nc->sram.pool) { 2308 - dev_err(nc->base.dev, "Missing SRAM\n"); 2309 - return -ENOMEM; 2310 - } 2307 + if (!nc->sram.pool) 2308 + return dev_err_probe(nc->base.dev, -EPROBE_DEFER, "Missing SRAM\n"); 2311 2309 2312 2310 nc->sram.virt = (void __iomem *)gen_pool_dma_alloc(nc->sram.pool, 2313 2311 ATMEL_NFC_SRAM_SIZE,