Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions drivers/watchdog/gpio_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
#include <linux/platform_device.h>
#include <linux/watchdog.h>

static bool nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(nowayout,
"Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");

#define SOFT_TIMEOUT_MIN 1
#define SOFT_TIMEOUT_DEF 60

Expand Down Expand Up @@ -154,25 +160,15 @@ static int gpio_wdt_probe(struct platform_device *pdev)
priv->wdd.parent = dev;
priv->wdd.timeout = SOFT_TIMEOUT_DEF;

watchdog_init_timeout(&priv->wdd, 0, &pdev->dev);
watchdog_init_timeout(&priv->wdd, 0, dev);
watchdog_set_nowayout(&priv->wdd, nowayout);

watchdog_stop_on_reboot(&priv->wdd);

if (priv->always_running)
gpio_wdt_start(&priv->wdd);

ret = watchdog_register_device(&priv->wdd);

return ret;
}

static int gpio_wdt_remove(struct platform_device *pdev)
{
struct gpio_wdt_priv *priv = platform_get_drvdata(pdev);

watchdog_unregister_device(&priv->wdd);

return 0;
return devm_watchdog_register_device(dev, &priv->wdd);
}

static const struct of_device_id gpio_wdt_dt_ids[] = {
Expand All @@ -187,7 +183,6 @@ static struct platform_driver gpio_wdt_driver = {
.of_match_table = gpio_wdt_dt_ids,
},
.probe = gpio_wdt_probe,
.remove = gpio_wdt_remove,
};

#ifdef CONFIG_GPIO_WATCHDOG_ARCH_INITCALL
Expand Down