[U-Boot] [PATCH v2] sunxi: Select CONFIG_OF_BOARD_SETUP from CONFIG_VIDEO

Hans de Goede hdegoede at redhat.com
Wed Mar 23 11:10:31 CET 2016


Hi,

On 23-03-16 10:26, Ian Campbell wrote:
> On Tue, 2016-03-22 at 23:08 +0100, Hans de Goede wrote:
>> Select OF_BOARD_SETUP when CONFIG_VIDEO is set, rather then having it
>> in
>> almost all our defconfigs. This also fixes it missing from some
>> recently
>> added defconfigs.
>>
>> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
>> ---
>> Changes in v2:
>> -Only select CONFIG_OF_BOARD_SETUP when CONFIG_VIDEO is set, rather
>> then always
>
> What were the warning you got with the first version? Is that something
> we should consider addressing instead? The link between OF_BOARD_SETUP
> and VIDEO is not entirely clear to me.

Out ft_board_Setup looks like this:

#ifdef CONFIG_OF_BOARD_SETUP
int ft_board_setup(void *blob, bd_t *bd)
{
#ifdef CONFIG_VIDEO_DT_SIMPLEFB
         return sunxi_simplefb_setup(blob);
#endif
}
#endif /* CONFIG_OF_BOARD_SETUP */

So without CONFIG_VIDEO we get a warning about a non void
function not having a return, we could change ft_board_setup() to:

#ifdef CONFIG_OF_BOARD_SETUP
int ft_board_setup(void *blob, bd_t *bd)
{
	int __maybe_unused r;

#ifdef CONFIG_VIDEO_DT_SIMPLEFB
	r = sunxi_simplefb_setup(blob);
	if (r)
		return r;
#endif
	return 0;
}
#endif /* CONFIG_OF_BOARD_SETUP */

Note the using of "int __maybe_unused r" outside of the
#ifdef CONFIG_VIDEO_DT_SIMPLEFB is deliberate, it is to
avoid having to move things around if / when we add
another ft setup function to call from ft_board_setup().

I believe that you're right and doing something like the
above + always selecting CONFIG_OF_BOARD_SETUP would be
better, I'll send a v3 soon.

Regards,

Hans


More information about the U-Boot mailing list