aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-09-12 19:14:07 -0400
committerKees Cook <keescook@chromium.org>2017-11-02 18:50:30 -0400
commitd1cadcb7cade0f98eb4c3b1e4c808cc8169da5e3 (patch)
treeb0db24747a00f7ee2642996600ca3ce77445766d /drivers
parent4fa42b4e5ddca6a58d8fcf24d51e6fe2f8c50253 (diff)
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: Kees Cook <keescook@chromium.org> Acked-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/watchdog/lpc18xx_wdt.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/watchdog/lpc18xx_wdt.c b/drivers/watchdog/lpc18xx_wdt.c
index 3b8bb59adf02..b4221f43cd94 100644
--- a/drivers/watchdog/lpc18xx_wdt.c
+++ b/drivers/watchdog/lpc18xx_wdt.c
@@ -78,10 +78,10 @@ static int lpc18xx_wdt_feed(struct watchdog_device *wdt_dev)
78 return 0; 78 return 0;
79} 79}
80 80
81static void lpc18xx_wdt_timer_feed(unsigned long data) 81static void lpc18xx_wdt_timer_feed(struct timer_list *t)
82{ 82{
83 struct watchdog_device *wdt_dev = (struct watchdog_device *)data; 83 struct lpc18xx_wdt_dev *lpc18xx_wdt = from_timer(lpc18xx_wdt, t, timer);
84 struct lpc18xx_wdt_dev *lpc18xx_wdt = watchdog_get_drvdata(wdt_dev); 84 struct watchdog_device *wdt_dev = &lpc18xx_wdt->wdt_dev;
85 85
86 lpc18xx_wdt_feed(wdt_dev); 86 lpc18xx_wdt_feed(wdt_dev);
87 87
@@ -96,7 +96,9 @@ static void lpc18xx_wdt_timer_feed(unsigned long data)
96 */ 96 */
97static int lpc18xx_wdt_stop(struct watchdog_device *wdt_dev) 97static int lpc18xx_wdt_stop(struct watchdog_device *wdt_dev)
98{ 98{
99 lpc18xx_wdt_timer_feed((unsigned long)wdt_dev); 99 struct lpc18xx_wdt_dev *lpc18xx_wdt = watchdog_get_drvdata(wdt_dev);
100
101 lpc18xx_wdt_timer_feed(&lpc18xx_wdt->timer);
100 102
101 return 0; 103 return 0;
102} 104}
@@ -267,8 +269,7 @@ static int lpc18xx_wdt_probe(struct platform_device *pdev)
267 269
268 __lpc18xx_wdt_set_timeout(lpc18xx_wdt); 270 __lpc18xx_wdt_set_timeout(lpc18xx_wdt);
269 271
270 setup_timer(&lpc18xx_wdt->timer, lpc18xx_wdt_timer_feed, 272 timer_setup(&lpc18xx_wdt->timer, lpc18xx_wdt_timer_feed, 0);
271 (unsigned long)&lpc18xx_wdt->wdt_dev);
272 273
273 watchdog_set_nowayout(&lpc18xx_wdt->wdt_dev, nowayout); 274 watchdog_set_nowayout(&lpc18xx_wdt->wdt_dev, nowayout);
274 watchdog_set_restart_priority(&lpc18xx_wdt->wdt_dev, 128); 275 watchdog_set_restart_priority(&lpc18xx_wdt->wdt_dev, 128);