[PATCH] watchdog: ulp_wdog: guard reset_cpu with condition check

Stefan Roese sr at denx.de
Tue Apr 11 11:38:44 CEST 2023


On 4/6/23 12:24, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan at nxp.com>
> 
> There will be build error if CONFIG_SYSRESET is enabled, so guard
> the reset_cpu with condition check here
> 
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> ---
>   drivers/watchdog/ulp_wdog.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/watchdog/ulp_wdog.c b/drivers/watchdog/ulp_wdog.c
> index c21aa3af55f..0eea04ed2c6 100644
> --- a/drivers/watchdog/ulp_wdog.c
> +++ b/drivers/watchdog/ulp_wdog.c
> @@ -122,6 +122,7 @@ void hw_watchdog_init(void)
>   	ulp_watchdog_init(wdog, CONFIG_WATCHDOG_TIMEOUT_MSECS);
>   }
>   
> +#if !CONFIG_IS_ENABLED(SYSRESET)
>   void reset_cpu(void)
>   {
>   	struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE_ADDR;
> @@ -159,6 +160,7 @@ void reset_cpu(void)
>   
>   	while (1);
>   }
> +#endif

Hmmm, isn't it possible to move reset_cpu() out of this file into some
other (platform?) directly? IMHO this API does not really belong into
the watchdog infrastructure.

Thanks,
Stefan


More information about the U-Boot mailing list