mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-09-22 23:52:03 +00:00
watchdog: Show error message when initr_watchdog() cannot start watchdog
Function wdt_start() may fail. So in initr_watchdog() function check return value of wdt_start() call and print error message when watchdog starting failed. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
9c44ff1c5f
commit
25e20e347e
1 changed files with 7 additions and 1 deletions
|
@ -27,6 +27,7 @@ static ulong reset_period = 1000;
|
|||
int initr_watchdog(void)
|
||||
{
|
||||
u32 timeout = WATCHDOG_TIMEOUT_SECS;
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* Init watchdog: This will call the probe function of the
|
||||
|
@ -50,7 +51,12 @@ int initr_watchdog(void)
|
|||
4 * reset_period) / 4;
|
||||
}
|
||||
|
||||
wdt_start(gd->watchdog_dev, timeout * 1000, 0);
|
||||
ret = wdt_start(gd->watchdog_dev, timeout * 1000, 0);
|
||||
if (ret != 0) {
|
||||
printf("WDT: Failed to start\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
printf("WDT: Started with%s servicing (%ds timeout)\n",
|
||||
IS_ENABLED(CONFIG_WATCHDOG) ? "" : "out", timeout);
|
||||
|
||||
|
|
Loading…
Reference in a new issue