diff mbox series

[21/42] watchdog: ulp_wdog: guard reset_cpu with condition check

Message ID 20230428040847.10841-22-peng.fan@oss.nxp.com
State Accepted
Commit fee8cf214af0807823865cfa4cc3d5e39eb8da3c
Delegated to: Stefano Babic
Headers show
Series imx: i.MX9 update | expand

Commit Message

Peng Fan (OSS) April 28, 2023, 4:08 a.m. UTC
From: Peng Fan <peng.fan@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@nxp.com>
---
 drivers/watchdog/ulp_wdog.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Stefan Roese April 28, 2023, 5:47 a.m. UTC | #1
On 4/28/23 06:08, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@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@nxp.com>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
>   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
>   
>   static int ulp_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
>   {

Viele Grüße,
Stefan Roese
Stefano Babic May 21, 2023, 5:12 p.m. UTC | #2
> From: Peng Fan <peng.fan@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@nxp.com>
> Reviewed-by: Stefan Roese <sr@denx.de>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

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
 
 static int ulp_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
 {