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] fixup! of: add function to read a file as unflattened device tree
Date: Mon, 22 May 2023 13:29:58 +0200	[thread overview]
Message-ID: <20230522112958.GN29365@pengutronix.de> (raw)
In-Reply-To: <20230519071939.2304443-1-a.fatoum@pengutronix.de>

On Fri, May 19, 2023 at 09:19:39AM +0200, Ahmad Fatoum wrote:
> of: tidy up of_read_file a bit
> 
>  - change a single instance of space indentation to tabs
>  - use %m instead of unwieldy strerror(errno)
>  - add documentation
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/of/base.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 918d5e0c5348..5da188115547 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -2893,6 +2893,12 @@ int of_device_disable_by_alias(const char *alias)
>  	return of_device_disable(node);
>  }
>  
> +/**
> + * of_read_file - unflatten oftree file
> + * @filename - path to file to unflatten its contents
> + *
> + * Returns the root node of the tree or an error pointer on error.
> + */
>  struct device_node *of_read_file(const char *filename)
>  {
>  	void *fdt;
> @@ -2901,8 +2907,7 @@ struct device_node *of_read_file(const char *filename)
>  
>  	fdt = read_file(filename, &size);
>  	if (!fdt) {
> -		pr_err("unable to read %s: %s\n", filename,
> -			strerror(errno));
> +		pr_err("unable to read %s: %m\n", filename);
>  		return ERR_PTR(-errno);
>  	}
>  
> @@ -2916,7 +2921,7 @@ struct device_node *of_read_file(const char *filename)
>  out:
>  	free(fdt);
>  
> -       return root;
> +	return root;
>  }
>  
>  /**
> -- 
> 2.39.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:[~2023-05-22 11:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-19  7:19 Ahmad Fatoum
2023-05-22 11:29 ` Sascha Hauer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-05-08  9:03 Ahmad Fatoum
2023-05-08 13:19 ` 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=20230522112958.GN29365@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