Skip to contentSkip to conversation

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

PATCH In review Ye Li 2 participants 2 messages Jan 31, 2023 Watchdog device drivers

lore
Share & tools
lore

Ye Li

author
#0 lore raw

PATCH 1/1 watchdog: ulp_wdog: only compile the code of DM driver when CONFIG_WDT=y

From: Alice Guo <[email protected]>

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.

---
 drivers/watchdog/ulp_wdog.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/watchdog/ulp_wdog.c +2 -0
index e081054..8f8182d 100644
@@ -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
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Ye Li

From: Alice Guo <[email protected]>

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.

Thanks,
Stefan

Quoted 17 lines
---
  drivers/watchdog/ulp_wdog.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/watchdog/ulp_wdog.c +1 -0
index e081054..8f8182d 100644
@@ -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);

drivers/watchdog/ulp_wdog.c U_BOOT_DRIVER(ulp_wdt) = { · line 226

Quoted 4 lines
drivers/watchdog/ulp_wdog.c +1 -0
@@ -222,3 +223,4 @@ U_BOOT_DRIVER(ulp_wdt) = {
  	.probe		= ulp_wdt_probe,
  	.ops	= &ulp_wdt_ops,
  };
+#endif

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]