From: Jan Kiszka <[email protected]> This allows to invoke it from board init code once more if probe ordering requires this. In that case, avoid to re-add already activated watchdog devices.
Signed-off-by: Jan Kiszka <[email protected]> --- drivers/watchdog/wdt-uclass.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c index 88c5cbdf508..338b03f0121 100644 --- a/drivers/watchdog/wdt-uclass.c +++ b/drivers/watchdog/wdt-uclass.c @@ -105,6 +105,13 @@ int initr_watchdog(void) } uclass_foreach_dev(dev, uc) { + /* + * initr_watchdog might be called multiple times to resolve + * for probe ordering issues. Skip already activated devices. + */ + if (device_active(dev)) + continue; + ret = device_probe(dev); if (ret) { log_debug("Error probing %s: %d\n", dev->name, ret); -- 2.47.3
