[PATCH 1/2] test/dm: fix watchdog test

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Thu Oct 28 12:16:17 CEST 2021


Avoid a build failure for CONFIG_WDT_GPIO=n.

We need this setting to test watchdog based system reset.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
 test/dm/wdt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/test/dm/wdt.c b/test/dm/wdt.c
index ee615f0e14..07a8eb0e7a 100644
--- a/test/dm/wdt.c
+++ b/test/dm/wdt.c
@@ -44,6 +44,7 @@ static int dm_test_wdt_base(struct unit_test_state *uts)
 }
 DM_TEST(dm_test_wdt_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
 
+#ifdef CONFIG_WDT_GPIO
 static int dm_test_wdt_gpio(struct unit_test_state *uts)
 {
 	/*
@@ -75,6 +76,7 @@ static int dm_test_wdt_gpio(struct unit_test_state *uts)
 	return 0;
 }
 DM_TEST(dm_test_wdt_gpio, UT_TESTF_SCAN_FDT);
+#endif
 
 static int dm_test_wdt_watchdog_reset(struct unit_test_state *uts)
 {
@@ -86,9 +88,11 @@ static int dm_test_wdt_watchdog_reset(struct unit_test_state *uts)
 	uint reset_count;
 	int val;
 
+#ifdef CONFIG_WDT_GPIO
 	ut_assertok(uclass_get_device_by_driver(UCLASS_WDT,
 						DM_DRIVER_GET(wdt_gpio), &gpio_wdt));
 	ut_assertnonnull(gpio_wdt);
+#endif
 	ut_assertok(uclass_get_device_by_driver(UCLASS_WDT,
 						DM_DRIVER_GET(wdt_sandbox), &sandbox_wdt));
 	ut_assertnonnull(sandbox_wdt);
-- 
2.32.0



More information about the U-Boot mailing list