[PATCH v4 05/12] rockchip: tpl: use IS_ENABLED for timer_init() call condition
Kever Yang
kever.yang at rock-chips.com
Wed Apr 6 16:37:32 CEST 2022
On 2022/4/4 07:06, Johan Jonker wrote:
> Not all Rockchip SoC models use the ARM arch timer.
> Call the function timer_init() only when
> CONFIG_SYS_ARCH_TIMER is available.
> Use the call condition IS_ENABLED to increase
> build coverage and make the code easier to read.
>
> Signed-off-by: Johan Jonker <jbx6244 at gmail.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Kever Yang <kever.yang at rock-chips.com>
Thanks,
- Kever
> ---
> arch/arm/mach-rockchip/tpl.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
> index 2b561264a5..05deba3f84 100644
> --- a/arch/arm/mach-rockchip/tpl.c
> +++ b/arch/arm/mach-rockchip/tpl.c
> @@ -80,8 +80,9 @@ void board_init_f(ulong dummy)
> if (IS_ENABLED(CONFIG_ROCKCHIP_STIMER))
> rockchip_stimer_init();
>
> - /* Init ARM arch timer in arch/arm/cpu/ */
> - timer_init();
> + /* Init ARM arch timer */
> + if (IS_ENABLED(CONFIG_SYS_ARCH_TIMER))
> + timer_init();
>
> ret = uclass_get_device(UCLASS_RAM, 0, &dev);
> if (ret) {
More information about the U-Boot
mailing list