]> git.ipfire.org Git - thirdparty/linux.git/commit
watchdog: atcwdt200: fix return value when watchdog is enabled
authorSurendra Singh Chouhan <kr494167@gmail.com>
Thu, 23 Jul 2026 02:26:34 +0000 (07:56 +0530)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 27 Jul 2026 22:08:15 +0000 (15:08 -0700)
commit8d2b10eef6f3b1336be2d1197db29b0c697f1d41
treefa0d3a673531aab12eddb70cbaed7bb4d299f05a
parentf5098b6bae761e346ebcd9da7f95622c04733cff
watchdog: atcwdt200: fix return value when watchdog is enabled

atcwdt_get_int_timer_type() returned TMR_UNKNOWN (enum value 3) when
CTRL_WDT_EN was set in the control register.

Because atcwdt_probe() checks "ret = atcwdt_get_int_timer_type(drv_data);
if (ret) return ret;", returning TMR_UNKNOWN caused probe() to return 3
instead of a valid negative error code.

Fix this by returning -EBUSY via dev_err_probe() when the watchdog is
already enabled and update the kernel-doc description accordingly.

Fixes: e4e0848ad046 ("watchdog: atcwdt200: Add driver for Andes ATCWDT200")
Signed-off-by: Surendra Singh Chouhan <kr494167@gmail.com>
Link: https://lore.kernel.org/r/20260723022634.8642-1-kr494167@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/watchdog/atcwdt200_wdt.c