task_wdt: fix silent init failures
The task_wdt_init() API can fail to install a timeout for the fallback hardware WDT (hw_wdt) without returning an error code. This patch enables task_wdt_init() to return the hw_wdt install timeout error code if the hw_wdt install timeout fails. Signed-off-by: Nick Ward <nick.ward@setec.com.au>
This commit is contained in:
parent
59b76b2e24
commit
e0f18128bf
3 changed files with 14 additions and 1 deletions
|
@ -136,6 +136,10 @@ int task_wdt_init(const struct device *hw_wdt)
|
|||
|
||||
hw_wdt_dev = hw_wdt;
|
||||
hw_wdt_channel = wdt_install_timeout(hw_wdt_dev, &wdt_config);
|
||||
if (hw_wdt_channel < 0) {
|
||||
LOG_ERR("hw_wdt install timeout failed: %d", hw_wdt_channel);
|
||||
return hw_wdt_channel;
|
||||
}
|
||||
#else
|
||||
return -ENOTSUP;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue