[PATCH] watchdog: ulp_wdog: only compile the code of DM driver when CONFIG_WDT=y

Ye Li ye.li at nxp.com
Tue Jan 31 07:59:03 CET 2023


From: Alice Guo <alice.guo at nxp.com>

DM watchdog timer driver and non-DM driver exist in ulp_wdog.c at the
same time. Add a compilation restriction that only compile the DM driver
part when CONFIG_WDT=y.

Signed-off-by: Alice Guo <alice.guo at nxp.com>
Reviewed-by: Ye Li <ye.li 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 e081054..8f8182d 100644
--- a/drivers/watchdog/ulp_wdog.c
+++ b/drivers/watchdog/ulp_wdog.c
@@ -164,6 +164,7 @@ void reset_cpu(void)
 	while (1);
 }
 
+#if CONFIG_IS_ENABLED(WDT)
 static int ulp_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
 {
 	struct ulp_wdt_priv *priv = dev_get_priv(dev);
@@ -222,3 +223,4 @@ U_BOOT_DRIVER(ulp_wdt) = {
 	.probe		= ulp_wdt_probe,
 	.ops	= &ulp_wdt_ops,
 };
+#endif
-- 
2.7.4



More information about the U-Boot mailing list