Skip to contentSkip to conversation

watchdog: rtd119x_wdt: Fix remove function

PATCH New Guenter Roeck 1 participant 1 message Apr 7, 2019 Watchdog device drivers

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 1/1 watchdog: rtd119x_wdt: Fix remove function

The driver registers the watchdog with devm_watchdog_register_device() but still calls watchdog_unregister_device() on remove. Since clocks have to be stopped when removing the driver, after the watchdog device has been unregistered, we can not drop the call to watchdog_unregister_device(). Use watchdog_register_device() to register the watchdog.

Fixes 2bdf6acbfead7 ("watchdog: Add Realtek RTD1295")
Cc Andreas Färber <[email protected]>
---
 drivers/watchdog/rtd119x_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/rtd119x_wdt.c +1 -1
index d823c9def36f..cb17c49f3534 100644
@@ -133,7 +133,7 @@ static int rtd119x_wdt_probe(struct platform_device *pdev)
 	rtd119x_wdt_set_timeout(&data->wdt_dev, data->wdt_dev.timeout);
 	rtd119x_wdt_stop(&data->wdt_dev);
 
-	ret = devm_watchdog_register_device(&pdev->dev, &data->wdt_dev);
+	ret = watchdog_register_device(&data->wdt_dev);
 	if (ret) {
 		clk_disable_unprepare(data->clk);
 		clk_put(data->clk);
Signature · 1 line
2.7.4