mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Peter Rosin <peda@axentia.se>, Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 4/5] ARM: at91: sam9_smc: register driver earlier
Date: Wed, 22 Sep 2021 08:50:00 +0200	[thread overview]
Message-ID: <20210922065000.20970-5-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20210922065000.20970-1-a.fatoum@pengutronix.de>

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@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,
 };
 
-coredevice_platform_driver(at91sam9_smc_driver);
+postcore_platform_driver(at91sam9_smc_driver);
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  parent reply	other threads:[~2021-09-22  6:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22  6:49 [PATCH 0/5] ARM: at91: sama5d3_xplained: migrate to DT Ahmad Fatoum
2021-09-22  6:49 ` [PATCH master 1/5] fs: fat: pbl: support >32M alignment for first partition Ahmad Fatoum
2021-09-22  6:49 ` [PATCH master 2/5] ARM: at91: at91sam9263ek: add device tree check for board code Ahmad Fatoum
2021-09-22  6:49 ` [PATCH 3/5] Documentation: boards: at91: remove done TODOs Ahmad Fatoum
2021-09-22 15:29   ` Sam Ravnborg
2021-09-22  6:50 ` Ahmad Fatoum [this message]
2021-09-22  6:50 ` [PATCH 5/5] ARM: AT91: migrate sama5d3-xplained to DT Ahmad Fatoum
2021-10-01 13:36 ` [PATCH 0/5] ARM: at91: sama5d3_xplained: migrate " Sascha Hauer

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=20210922065000.20970-5-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=peda@axentia.se \
    /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