[PATCH 4/5] ARM: at91: sam9_smc: register driver earlier

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Sep 21 23:50:00 PDT 2021

The driver probe only depends on the device's resources, so there is no
need to delay registration to coredevice_platform_driver. The way the
AT91 code is structured is that:

  - board code adds SMC device (not probed from DT, so no deep probe)
  - SMC driver probe runs and stores regions
  - board code calls into SMC driver to apply config to regions
  - board code registers NAND

Failure to keep this order results either in non-functional NAND
or crash. Take the easy way out.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
 arch/arm/mach-at91/sam9_smc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-at91/sam9_smc.c b/arch/arm/mach-at91/sam9_smc.c
index 66261a95ee01..77d62012dfb6 100644
--- a/arch/arm/mach-at91/sam9_smc.c
+++ b/arch/arm/mach-at91/sam9_smc.c
@@ -195,4 +195,4 @@ static struct driver_d at91sam9_smc_driver = {
 	.probe = at91sam9_smc_probe,

More information about the barebox mailing list