Commit d1cadcb7 authored by Kees Cook's avatar Kees Cook

watchdog: lpc18xx_wdt: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Joachim Eastwood <manabian@gmail.com>
Cc: linux-watchdog@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 4fa42b4e
...@@ -78,10 +78,10 @@ static int lpc18xx_wdt_feed(struct watchdog_device *wdt_dev) ...@@ -78,10 +78,10 @@ static int lpc18xx_wdt_feed(struct watchdog_device *wdt_dev)
return 0; return 0;
} }
static void lpc18xx_wdt_timer_feed(unsigned long data) static void lpc18xx_wdt_timer_feed(struct timer_list *t)
{ {
struct watchdog_device *wdt_dev = (struct watchdog_device *)data; struct lpc18xx_wdt_dev *lpc18xx_wdt = from_timer(lpc18xx_wdt, t, timer);
struct lpc18xx_wdt_dev *lpc18xx_wdt = watchdog_get_drvdata(wdt_dev); struct watchdog_device *wdt_dev = &lpc18xx_wdt->wdt_dev;
lpc18xx_wdt_feed(wdt_dev); lpc18xx_wdt_feed(wdt_dev);
...@@ -96,7 +96,9 @@ static void lpc18xx_wdt_timer_feed(unsigned long data) ...@@ -96,7 +96,9 @@ static void lpc18xx_wdt_timer_feed(unsigned long data)
*/ */
static int lpc18xx_wdt_stop(struct watchdog_device *wdt_dev) static int lpc18xx_wdt_stop(struct watchdog_device *wdt_dev)
{ {
lpc18xx_wdt_timer_feed((unsigned long)wdt_dev); struct lpc18xx_wdt_dev *lpc18xx_wdt = watchdog_get_drvdata(wdt_dev);
lpc18xx_wdt_timer_feed(&lpc18xx_wdt->timer);
return 0; return 0;
} }
...@@ -267,8 +269,7 @@ static int lpc18xx_wdt_probe(struct platform_device *pdev) ...@@ -267,8 +269,7 @@ static int lpc18xx_wdt_probe(struct platform_device *pdev)
__lpc18xx_wdt_set_timeout(lpc18xx_wdt); __lpc18xx_wdt_set_timeout(lpc18xx_wdt);
setup_timer(&lpc18xx_wdt->timer, lpc18xx_wdt_timer_feed, timer_setup(&lpc18xx_wdt->timer, lpc18xx_wdt_timer_feed, 0);
(unsigned long)&lpc18xx_wdt->wdt_dev);
watchdog_set_nowayout(&lpc18xx_wdt->wdt_dev, nowayout); watchdog_set_nowayout(&lpc18xx_wdt->wdt_dev, nowayout);
watchdog_set_restart_priority(&lpc18xx_wdt->wdt_dev, 128); watchdog_set_restart_priority(&lpc18xx_wdt->wdt_dev, 128);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment