[Uboot-stm32] [PATCH] dm: core: convert of_machine_is_compatible to livetree

Patrice CHOTARD patrice.chotard at foss.st.com
Mon May 23 08:42:39 CEST 2022


HI Patrick

On 5/17/22 14:37, Patrick Delaunay wrote:
> Replace in the function of_machine_is_compatible(), the used API
> fdt_node_check_compatible() by ofnode_device_is_compatible()
> to support a live tree.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
> ---
> 
>  drivers/core/device.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/core/device.c b/drivers/core/device.c
> index 3ab2583df3..3199d6a1b7 100644
> --- a/drivers/core/device.c
> +++ b/drivers/core/device.c
> @@ -1125,9 +1125,7 @@ bool device_is_compatible(const struct udevice *dev, const char *compat)
>  
>  bool of_machine_is_compatible(const char *compat)
>  {
> -	const void *fdt = gd->fdt_blob;
> -
> -	return !fdt_node_check_compatible(fdt, 0, compat);
> +	return ofnode_device_is_compatible(ofnode_root(), compat);
>  }
>  
>  int dev_disable_by_path(const char *path)

Reviewed-by: Patrice Chotard <patrice.chotard at foss.st.com>

Thanks
Patrice


More information about the U-Boot mailing list