diff options
Diffstat (limited to 'drivers/watchdog/wd_core.c')
-rw-r--r-- | drivers/watchdog/wd_core.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/watchdog/wd_core.c b/drivers/watchdog/wd_core.c index 07fe9b030e..8b13950238 100644 --- a/drivers/watchdog/wd_core.c +++ b/drivers/watchdog/wd_core.c @@ -158,20 +158,21 @@ int watchdog_register(struct watchdog *wd) if (!wd->timeout_max) wd->timeout_max = 60 * 60 * 24; - if (!wd->poller_timeout_cur || wd->poller_timeout_cur > wd->timeout_max) - wd->poller_timeout_cur = wd->timeout_max; - p = dev_add_param_uint32_ro(&wd->dev, "timeout_max", &wd->timeout_max, "%u"); if (IS_ERR(p)) return PTR_ERR(p); - p = dev_add_param_uint32(&wd->dev, "timeout_cur", watchdog_set_cur, NULL, - &wd->poller_timeout_cur, "%u", wd); - if (IS_ERR(p)) - return PTR_ERR(p); - if (IS_ENABLED(CONFIG_WATCHDOG_POLLER)) { + if (!wd->poller_timeout_cur || + wd->poller_timeout_cur > wd->timeout_max) + wd->poller_timeout_cur = wd->timeout_max; + + p = dev_add_param_uint32(&wd->dev, "timeout_cur", watchdog_set_cur, + NULL, &wd->poller_timeout_cur, "%u", wd); + if (IS_ERR(p)) + return PTR_ERR(p); + ret = watchdog_register_poller(wd); if (ret) return ret; |