Handle the error code returned by cyclic_register() and propagate it.
Signed-off-by: Marek Vasut <[email protected]>
---
Cc: Aaron Williams <[email protected]>
Cc: Anatolij Gustschin <[email protected]>
Cc: Angelo Dureghello <[email protected]>
Cc: Christian Marangi <[email protected]>
Cc: Devarsh Thakkar <[email protected]>
Cc: Heinrich Schuchardt <[email protected]>
Cc: Jaehoon Chung <[email protected]>
Cc: Michael Polyntsov <[email protected]>
Cc: Michael Trimarchi <[email protected]>
Cc: Nikhil M Jain <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Peter Robinson <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Cc: Ronald Wahl <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Stefan Roese <[email protected]>
Cc: Tim Harvey <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
---
drivers/watchdog/wdt-uclass.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c
index 10be334e9ed..5778c8bee40 100644
--- a/drivers/watchdog/wdt-uclass.c
+++ b/drivers/watchdog/wdt-uclass.c
@@ -129,9 +129,11 @@ int wdt_start(struct udevice *dev, u64 timeout_ms, ulong
flags)
cyclic_unregister(&priv->cyclic);
/* Register the watchdog driver as a cyclic function */
- cyclic_register(&priv->cyclic, wdt_cyclic,
- priv->reset_period * 1000,
- dev->name);
+ ret = cyclic_register(&priv->cyclic, wdt_cyclic,
+ priv->reset_period * 1000,
+ dev->name);
+ if (ret)
+ return ret;
snprintf(str, 16, "every %ldms", priv->reset_period);
}
--
2.45.2