mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] of: of_probe: create board's machine device at the earliest
Date: Tue, 13 Sep 2022 10:27:55 +0200	[thread overview]
Message-ID: <20220913082755.GL6477@pengutronix.de> (raw)
In-Reply-To: <20220905070208.538012-1-a.fatoum@pengutronix.de>

On Mon, Sep 05, 2022 at 09:02:08AM +0200, Ahmad Fatoum wrote:
> We currently create devices for matching reserved memory entries and
> firmware before creating the machine device. In a deep probe system, the
> machine driver would be probed directly at registration and as such
> needs to be probed before other devices are created, so it can disable
> other devices if needed. Move the machine device registration to the
> top, so board drivers can disabled reserved memory entries and firmware
> if they need to.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/of/base.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 52e6a9294e11..6a51dd71793d 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -2503,6 +2503,12 @@ int of_probe(void)
>  	if(!root_node)
>  		return -ENODEV;
>  
> +	/*
> +	 * We do this first thing, so board drivers can patch the device
> +	 * tree prior to device creation if needed.
> +	 */
> +	of_platform_device_create_root(root_node);
> +
>  	/*
>  	 * Handle certain compatibles explicitly, since we don't want to create
>  	 * platform_devices for every node in /reserved-memory with a
> @@ -2515,8 +2521,6 @@ int of_probe(void)
>  	if (node)
>  		of_platform_populate(node, NULL, NULL);
>  
> -	of_platform_device_create_root(root_node);
> -
>  	of_platform_populate(root_node, of_default_bus_match_table, NULL);
>  
>  	return 0;
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      reply	other threads:[~2022-09-13  8:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05  7:02 Ahmad Fatoum
2022-09-13  8:27 ` Sascha Hauer [this message]

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=20220913082755.GL6477@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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