diff options
| author | Felix Gu <ustc.gu@gmail.com> | 2026-02-23 14:59:20 +0300 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2026-05-03 23:49:51 +0300 |
| commit | 96b3cfc3b8ad0524d12fed1e08bc5df3ff345f64 (patch) | |
| tree | fdfd0609522e420a7ed18e304f89ce9e023e3674 | |
| parent | bdd918c4e4516bd2eadac712b2d2e6d29445bd2e (diff) | |
| download | linux-96b3cfc3b8ad0524d12fed1e08bc5df3ff345f64.tar.xz | |
watchdog: sprd_wdt: Remove redundant sprd_wdt_disable() on register failure
The driver uses devm_add_action_or_reset() to register sprd_wdt_disable()
as a managed cleanup action.
When devm_watchdog_register_device() fails, the devm core will invoke
the cleanup action automatically.
The explicit sprd_wdt_disable() call in the error path is therefore
redundant and results in adouble cleanup.
Fixes: 78d9bfad2e89 ("watchdog: sprd_wdt: Convert to use device managed functions and other improvements")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Link: https://lore.kernel.org/r/20260223-sprd_wdt-v1-1-2e71f9a76ecb@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| -rw-r--r-- | drivers/watchdog/sprd_wdt.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/watchdog/sprd_wdt.c b/drivers/watchdog/sprd_wdt.c index 4e689b6ff141..aacf04616fef 100644 --- a/drivers/watchdog/sprd_wdt.c +++ b/drivers/watchdog/sprd_wdt.c @@ -320,10 +320,9 @@ static int sprd_wdt_probe(struct platform_device *pdev) watchdog_init_timeout(&wdt->wdd, 0, dev); ret = devm_watchdog_register_device(dev, &wdt->wdd); - if (ret) { - sprd_wdt_disable(wdt); + if (ret) return ret; - } + platform_set_drvdata(pdev, wdt); return 0; |
