mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Riesch <michael.riesch@wolfvision.net>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH] common: boards: wolfvision: use state_by_alias instead of opencoding
Date: Wed, 15 May 2024 08:29:27 +0200	[thread overview]
Message-ID: <008b5e2e-85b9-4a15-845e-70af7809f769@wolfvision.net> (raw)
In-Reply-To: <20240515060736.3580327-1-a.fatoum@pengutronix.de>

Hi Ahmad,

Thanks a lot for your patch!

On 5/15/24 08:07, Ahmad Fatoum wrote:
> This introduces no functional change, but makes code a bit more compact.
> 
> Cc: Michael Riesch <michael.riesch@wolfvision.net>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  common/boards/wolfvision/common.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/common/boards/wolfvision/common.c b/common/boards/wolfvision/common.c
> index f483918cecfe..5484a8ac6b06 100644
> --- a/common/boards/wolfvision/common.c
> +++ b/common/boards/wolfvision/common.c
> @@ -62,11 +62,7 @@ int wolfvision_register_ethaddr(void)
>  	char mac[ETH_ALEN];
>  	int ret;
>  
> -	ret = of_device_ensure_probed_by_alias("state");

Just to be on the safe side: of_device_ensure_probed_by_alias makes sure
that the underlying drivers are probed, right?

> -	if (ret)
> -		return ret;
> -
> -	state = state_by_name("state");
> +	state = state_by_alias("state");

state_by_alias, on the other hand, calls only of_find_node_by_alias,
which (as I presume) does not ensure that.

IIRC the of_device_ensure_... magic was necessary in our setup, but I
can give your patch a test during the next round of barebox board code
cleanups.

Best regards,
Michael

>  	if (!state)
>  		return -ENOENT;
>  



  reply	other threads:[~2024-05-15  6:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15  6:07 Ahmad Fatoum
2024-05-15  6:29 ` Michael Riesch [this message]
2024-05-15  6:35   ` Ahmad Fatoum
2024-05-15  6:39     ` Michael Riesch
2024-05-16  7:18 ` 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=008b5e2e-85b9-4a15-845e-70af7809f769@wolfvision.net \
    --to=michael.riesch@wolfvision.net \
    --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