Re: [PATCH] fixup! of: add function to read a file as unflattened device tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
> ---
>  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 |




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux