watchdog: sprd_wdt: Remove redundant sprd_wdt_disable() on register failure
Subsystems (2)
PATCH 1/1 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.
--- drivers/watchdog/sprd_wdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/watchdog/sprd_wdt.c +2 -3
@@ -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 ;
---
base-commit: d4906ae14a5f136ceb671bb14cedbf13fa560da6
change-id: 20260223-sprd_wdt-3e7ec7187f30
Best regards,
Signature · 1 line
Felix Gu <[email protected]>
Quoted 11 lines · Felix Gu
The driver uses
devm_add_action_or_reset()to registersprd_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 <[email protected]>
Quoted 11 lines · Felix Gu
The driver uses
devm_add_action_or_reset()to registersprd_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 <[email protected]>
Good catch. Thanks.
Quoted 27 lines
--- drivers/watchdog/sprd_wdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/watchdog/sprd_wdt.c +2
-4@@ -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 ; ---base-commit:
d4906ae14a5f136ceb671bb14cedbf13fa560da6
change-id: 20260223-sprd_wdt-3e7ec7187f30Best regards,
Hi Guenter,
Gentle ping.
Is it good to merge?
Best Felix
Guenter Roeck
maintainerQuoted 5 lines · Felix Gu
Hi Guenter,
Gentle ping.
Is it good to merge?Best Felix
I checked. The patch is queued in my watchdog-next, and I just confirmed that it is in linux-next (next-20260522). What else are you looking for ?
Guenter
Quoted 11 lines · Guenter Roeck
Quoted 5 lines · Felix Gu
Hi Guenter,
Gentle ping.
Is it good to merge?Best Felix
I checked. The patch is queued in my watchdog-next, and I just confirmed that it is in linux-next (next-20260522). What else are you looking for ?
Hi Guenter,
Thanks.
I didn't notice it was already in the linux-next.
Best regards,
Felix
Quoted 2 lines
Guenter