[U-Boot] [PATCH 06/15] wdt: designware: Simplify is_enabled function

Jagan Teki jagan at amarulasolutions.com
Mon Jul 29 07:47:02 UTC 2019


Right now the designware is_enabled function is using
numeric number to check whether watchdog is enabled or
not, so use register macro and check the same.

Cc: Chin Liang See <clsee at altera.com>
Cc: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
 drivers/watchdog/designware_wdt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c
index c668567c66..bd858f0608 100644
--- a/drivers/watchdog/designware_wdt.c
+++ b/drivers/watchdog/designware_wdt.c
@@ -45,9 +45,7 @@ static void designware_wdt_enable(void)
 
 static unsigned int designware_wdt_is_enabled(void)
 {
-	unsigned long val;
-	val = readl((CONFIG_DW_WDT_BASE + DW_WDT_CR));
-	return val & 0x1;
+	return readl(CONFIG_DW_WDT_BASE + DW_WDT_CR) & DW_WDT_CR_RMOD_OFFSET;
 }
 
 #if defined(CONFIG_HW_WATCHDOG)
-- 
2.18.0.321.gffc6fa0e3



More information about the U-Boot mailing list