From 8967ebb65386396790e4c1c8b7c24a139a0f5c41 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Thu, 19 Aug 2021 11:56:55 +0200 Subject: watchdog: wdt-uclass.c: use wdt_start() in wdt_expire_now() wdt_start() does the "no ->start? return -ENOSYS" check, don't open-code that in wdt_expire_now(). Also, wdt_start() maintains some global (and later some per-device) state, which would get out of sync with this direct method call - not that it matters much here since the board is supposed to reset very soon. Reviewed-by: Simon Glass Reviewed-by: Stefan Roese Signed-off-by: Rasmus Villemoes --- drivers/watchdog/wdt-uclass.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/watchdog/wdt-uclass.c') diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c index 17334dbda6..df8164da2a 100644 --- a/drivers/watchdog/wdt-uclass.c +++ b/drivers/watchdog/wdt-uclass.c @@ -120,10 +120,8 @@ int wdt_expire_now(struct udevice *dev, ulong flags) if (ops->expire_now) { return ops->expire_now(dev, flags); } else { - if (!ops->start) - return -ENOSYS; + ret = wdt_start(dev, 1, flags); - ret = ops->start(dev, 1, flags); if (ret < 0) return ret; -- cgit v1.2.3