diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-24 12:44:48 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-10-24 13:09:33 -0400 |
commit | ee03e3f00566201ea91d90430dc43bd08c7e9eef (patch) | |
tree | 683c6c65583c06d643bf6a42b39d05b36a8bd239 | |
parent | 4ea40278eb463aaa95889b00be78f8a56bb61131 (diff) |
Input: touchsceen - 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.
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/touchscreen/ad7879.c | 6 | ||||
-rw-r--r-- | drivers/input/touchscreen/atmel-wm97xx.c | 10 | ||||
-rw-r--r-- | drivers/input/touchscreen/cyttsp4_core.c | 7 | ||||
-rw-r--r-- | drivers/input/touchscreen/tsc200x-core.c | 6 | ||||
-rw-r--r-- | drivers/input/touchscreen/w90p910_ts.c | 7 |
5 files changed, 18 insertions, 18 deletions
diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c index 7d74a0ae2c94..6bad23ee47a1 100644 --- a/drivers/input/touchscreen/ad7879.c +++ b/drivers/input/touchscreen/ad7879.c | |||
@@ -237,9 +237,9 @@ static void ad7879_ts_event_release(struct ad7879 *ts) | |||
237 | input_sync(input_dev); | 237 | input_sync(input_dev); |
238 | } | 238 | } |
239 | 239 | ||
240 | static void ad7879_timer(unsigned long handle) | 240 | static void ad7879_timer(struct timer_list *t) |
241 | { | 241 | { |
242 | struct ad7879 *ts = (void *)handle; | 242 | struct ad7879 *ts = from_timer(ts, t, timer); |
243 | 243 | ||
244 | ad7879_ts_event_release(ts); | 244 | ad7879_ts_event_release(ts); |
245 | } | 245 | } |
@@ -570,7 +570,7 @@ int ad7879_probe(struct device *dev, struct regmap *regmap, | |||
570 | ts->irq = irq; | 570 | ts->irq = irq; |
571 | ts->regmap = regmap; | 571 | ts->regmap = regmap; |
572 | 572 | ||
573 | setup_timer(&ts->timer, ad7879_timer, (unsigned long) ts); | 573 | timer_setup(&ts->timer, ad7879_timer, 0); |
574 | snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(dev)); | 574 | snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(dev)); |
575 | 575 | ||
576 | input_dev->name = "AD7879 Touchscreen"; | 576 | input_dev->name = "AD7879 Touchscreen"; |
diff --git a/drivers/input/touchscreen/atmel-wm97xx.c b/drivers/input/touchscreen/atmel-wm97xx.c index 8cf0b2be2df4..9140a43cfe20 100644 --- a/drivers/input/touchscreen/atmel-wm97xx.c +++ b/drivers/input/touchscreen/atmel-wm97xx.c | |||
@@ -208,9 +208,12 @@ static void atmel_wm97xx_acc_pen_up(struct wm97xx *wm) | |||
208 | } | 208 | } |
209 | } | 209 | } |
210 | 210 | ||
211 | static void atmel_wm97xx_pen_timer(unsigned long data) | 211 | static void atmel_wm97xx_pen_timer(struct timer_list *t) |
212 | { | 212 | { |
213 | atmel_wm97xx_acc_pen_up((struct wm97xx *)data); | 213 | struct atmel_wm97xx *atmel_wm97xx = from_timer(atmel_wm97xx, t, |
214 | pen_timer); | ||
215 | |||
216 | atmel_wm97xx_acc_pen_up(atmel_wm97xx->wm); | ||
214 | } | 217 | } |
215 | 218 | ||
216 | static int atmel_wm97xx_acc_startup(struct wm97xx *wm) | 219 | static int atmel_wm97xx_acc_startup(struct wm97xx *wm) |
@@ -348,8 +351,7 @@ static int __init atmel_wm97xx_probe(struct platform_device *pdev) | |||
348 | atmel_wm97xx->gpio_pen = atmel_gpio_line; | 351 | atmel_wm97xx->gpio_pen = atmel_gpio_line; |
349 | atmel_wm97xx->gpio_irq = gpio_to_irq(atmel_wm97xx->gpio_pen); | 352 | atmel_wm97xx->gpio_irq = gpio_to_irq(atmel_wm97xx->gpio_pen); |
350 | 353 | ||
351 | setup_timer(&atmel_wm97xx->pen_timer, atmel_wm97xx_pen_timer, | 354 | timer_setup(&atmel_wm97xx->pen_timer, atmel_wm97xx_pen_timer, 0); |
352 | (unsigned long)wm); | ||
353 | 355 | ||
354 | ret = request_irq(atmel_wm97xx->ac97c_irq, | 356 | ret = request_irq(atmel_wm97xx->ac97c_irq, |
355 | atmel_wm97xx_channel_b_interrupt, | 357 | atmel_wm97xx_channel_b_interrupt, |
diff --git a/drivers/input/touchscreen/cyttsp4_core.c b/drivers/input/touchscreen/cyttsp4_core.c index beaf61ce775b..e7710397e0ad 100644 --- a/drivers/input/touchscreen/cyttsp4_core.c +++ b/drivers/input/touchscreen/cyttsp4_core.c | |||
@@ -1237,9 +1237,9 @@ static void cyttsp4_stop_wd_timer(struct cyttsp4 *cd) | |||
1237 | del_timer_sync(&cd->watchdog_timer); | 1237 | del_timer_sync(&cd->watchdog_timer); |
1238 | } | 1238 | } |
1239 | 1239 | ||
1240 | static void cyttsp4_watchdog_timer(unsigned long handle) | 1240 | static void cyttsp4_watchdog_timer(struct timer_list *t) |
1241 | { | 1241 | { |
1242 | struct cyttsp4 *cd = (struct cyttsp4 *)handle; | 1242 | struct cyttsp4 *cd = from_timer(cd, t, watchdog_timer); |
1243 | 1243 | ||
1244 | dev_vdbg(cd->dev, "%s: Watchdog timer triggered\n", __func__); | 1244 | dev_vdbg(cd->dev, "%s: Watchdog timer triggered\n", __func__); |
1245 | 1245 | ||
@@ -2074,8 +2074,7 @@ struct cyttsp4 *cyttsp4_probe(const struct cyttsp4_bus_ops *ops, | |||
2074 | } | 2074 | } |
2075 | 2075 | ||
2076 | /* Setup watchdog timer */ | 2076 | /* Setup watchdog timer */ |
2077 | setup_timer(&cd->watchdog_timer, cyttsp4_watchdog_timer, | 2077 | timer_setup(&cd->watchdog_timer, cyttsp4_watchdog_timer, 0); |
2078 | (unsigned long)cd); | ||
2079 | 2078 | ||
2080 | /* | 2079 | /* |
2081 | * call startup directly to ensure that the device | 2080 | * call startup directly to ensure that the device |
diff --git a/drivers/input/touchscreen/tsc200x-core.c b/drivers/input/touchscreen/tsc200x-core.c index 88ea5e1b72ae..542db26d7fd0 100644 --- a/drivers/input/touchscreen/tsc200x-core.c +++ b/drivers/input/touchscreen/tsc200x-core.c | |||
@@ -202,9 +202,9 @@ out: | |||
202 | return IRQ_HANDLED; | 202 | return IRQ_HANDLED; |
203 | } | 203 | } |
204 | 204 | ||
205 | static void tsc200x_penup_timer(unsigned long data) | 205 | static void tsc200x_penup_timer(struct timer_list *t) |
206 | { | 206 | { |
207 | struct tsc200x *ts = (struct tsc200x *)data; | 207 | struct tsc200x *ts = from_timer(ts, t, penup_timer); |
208 | unsigned long flags; | 208 | unsigned long flags; |
209 | 209 | ||
210 | spin_lock_irqsave(&ts->lock, flags); | 210 | spin_lock_irqsave(&ts->lock, flags); |
@@ -506,7 +506,7 @@ int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id, | |||
506 | mutex_init(&ts->mutex); | 506 | mutex_init(&ts->mutex); |
507 | 507 | ||
508 | spin_lock_init(&ts->lock); | 508 | spin_lock_init(&ts->lock); |
509 | setup_timer(&ts->penup_timer, tsc200x_penup_timer, (unsigned long)ts); | 509 | timer_setup(&ts->penup_timer, tsc200x_penup_timer, 0); |
510 | 510 | ||
511 | INIT_DELAYED_WORK(&ts->esd_work, tsc200x_esd_work); | 511 | INIT_DELAYED_WORK(&ts->esd_work, tsc200x_esd_work); |
512 | 512 | ||
diff --git a/drivers/input/touchscreen/w90p910_ts.c b/drivers/input/touchscreen/w90p910_ts.c index da6004e97753..638c1d78ca3a 100644 --- a/drivers/input/touchscreen/w90p910_ts.c +++ b/drivers/input/touchscreen/w90p910_ts.c | |||
@@ -146,9 +146,9 @@ static irqreturn_t w90p910_ts_interrupt(int irq, void *dev_id) | |||
146 | return IRQ_HANDLED; | 146 | return IRQ_HANDLED; |
147 | } | 147 | } |
148 | 148 | ||
149 | static void w90p910_check_pen_up(unsigned long data) | 149 | static void w90p910_check_pen_up(struct timer_list *t) |
150 | { | 150 | { |
151 | struct w90p910_ts *w90p910_ts = (struct w90p910_ts *) data; | 151 | struct w90p910_ts *w90p910_ts = from_timer(w90p910_ts, t, timer); |
152 | unsigned long flags; | 152 | unsigned long flags; |
153 | 153 | ||
154 | spin_lock_irqsave(&w90p910_ts->lock, flags); | 154 | spin_lock_irqsave(&w90p910_ts->lock, flags); |
@@ -232,8 +232,7 @@ static int w90x900ts_probe(struct platform_device *pdev) | |||
232 | w90p910_ts->input = input_dev; | 232 | w90p910_ts->input = input_dev; |
233 | w90p910_ts->state = TS_IDLE; | 233 | w90p910_ts->state = TS_IDLE; |
234 | spin_lock_init(&w90p910_ts->lock); | 234 | spin_lock_init(&w90p910_ts->lock); |
235 | setup_timer(&w90p910_ts->timer, w90p910_check_pen_up, | 235 | timer_setup(&w90p910_ts->timer, w90p910_check_pen_up, 0); |
236 | (unsigned long)w90p910_ts); | ||
237 | 236 | ||
238 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 237 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
239 | if (!res) { | 238 | if (!res) { |