linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: ad7877: Convert timers to use timer_setup()
@ 2017-10-23  8:40 stephen lu
  2017-10-23 21:54 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: stephen lu @ 2017-10-23  8:40 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, linux-kernel

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: Stephen Lu <lumotuwe@gmail.com>

---
 drivers/input/touchscreen/ad7877.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/ad7877.c
b/drivers/input/touchscreen/ad7877.c
index 9c250ae..0381c78 100644
--- a/drivers/input/touchscreen/ad7877.c
+++ b/drivers/input/touchscreen/ad7877.c
@@ -385,9 +385,9 @@ static inline void ad7877_ts_event_release(struct
ad7877 *ts)
        input_sync(input_dev);
 }

-static void ad7877_timer(unsigned long handle)
+static void ad7877_timer(struct timer_list *t)
 {
-       struct ad7877 *ts = (void *)handle;
+       struct ad7877 *ts = from_timer(ts, t, timer);
        unsigned long flags;

        spin_lock_irqsave(&ts->lock, flags);
@@ -718,7 +718,7 @@ static int ad7877_probe(struct spi_device *spi)
        ts->spi = spi;
        ts->input = input_dev;

-       setup_timer(&ts->timer, ad7877_timer, (unsigned long) ts);
+       timer_setup(&ts->timer, ad7877_timer, 0);
        mutex_init(&ts->mutex);
        spin_lock_init(&ts->lock);

-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-23 21:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-23  8:40 [PATCH] input: ad7877: Convert timers to use timer_setup() stephen lu
2017-10-23 21:54 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).