[PATCH 1/1] rpi: Fix build error when CONFIG_VIDEO is disabled for Raspberry Pi

Ivan T. Ivanov iivanov at suse.de
Fri Sep 20 10:16:25 CEST 2024


Hi,

On 09-20 08:32, Martin Stolpe wrote:
> 
> When the CONFIG_VIDEO option is set to disabled for Raspberry Pi devices
> the build will fail with the following error message:
> "undefined reference to `fdt_simplefb_enable_and_mem_rsv'."
> 
> Signed-off-by: Martin Stolpe <martin.stolpe at gmail.com>
> ---
> 
>  board/raspberrypi/rpi/rpi.c | 2 +-
>  boot/fdt_simplefb.c         | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
> index ab5ea85cf9..bc49708f85 100644
> --- a/board/raspberrypi/rpi/rpi.c
> +++ b/board/raspberrypi/rpi/rpi.c
> @@ -572,7 +572,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
>  	node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer");
>  	if (node < 0)
>  		fdt_simplefb_add_node(blob);
> -	else
> +	else if (IS_ENABLED(CONFIG_VIDEO))
>  		fdt_simplefb_enable_and_mem_rsv(blob);

I think there is one more user of this function which end of same
situation stm32mp1.

>  
>  #ifdef CONFIG_EFI_LOADER
> diff --git a/boot/fdt_simplefb.c b/boot/fdt_simplefb.c
> index 5341554845..b6e916ff7d 100644
> --- a/boot/fdt_simplefb.c
> +++ b/boot/fdt_simplefb.c
> @@ -86,6 +86,7 @@ int fdt_simplefb_add_node(void *blob)
>  	return fdt_simplefb_configure_node(blob, off);
>  }
>  
> +#if IS_ENABLED(CONFIG_VIDEO)
>  /**
>   * fdt_simplefb_enable_existing_node() - enable simple-framebuffer DT node
>   *
> @@ -103,7 +104,6 @@ static int fdt_simplefb_enable_existing_node(void *blob)
>  	return fdt_simplefb_configure_node(blob, off);
>  }
>  
> -#if IS_ENABLED(CONFIG_VIDEO)
>  int fdt_simplefb_enable_and_mem_rsv(void *blob)
>  {

Perhaps it will be better if above check is moved inside this function
making it empty in case of CONFIG_VIDEO is not set. This way you will
not need to modify it users.

Regards,
Ivan




More information about the U-Boot mailing list