Re: [PATCH 8/9] watchdog: w83627hf_wdt: Report all initialization failures in probe
From: Guenter Roeck
Date: Sat Jul 25 2026 - 10:29:25 EST
On 7/25/26 03:29, Paul Louvel wrote:
The driver currently logs an error only if the chip initialization
fails. Extend the error reporting to all failure paths in probe to
improve diagnostics.
Signed-off-by: Paul Louvel <paul.louvel@xxxxxxxxxxx>
---
drivers/watchdog/w83627hf_wdt.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
index 90d41f21aa5e..cf1a3fb3a6fd 100644
--- a/drivers/watchdog/w83627hf_wdt.c
+++ b/drivers/watchdog/w83627hf_wdt.c
@@ -479,12 +479,16 @@ static int wdt_probe(struct platform_device *pdev)
pr_info("WDT driver for %s Super I/O chip initialising\n", id->name);
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
- if (!res)
- return -ENXIO;
+ if (!res) {
+ ret = -ENXIO;
+ goto fail;
No way. Use "return dev_err_probe(...);" instead.> + }
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
- if (!data)
- return -ENOMEM;
+ if (!data) {
+ ret = -ENOMEM;
+ goto fail;
+ }
Not for this one, as Sashiko points out.
Guenter