diff options
-rw-r--r-- | drivers/input/input.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index 762bfb9487dc..44916ef4a424 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -76,7 +76,7 @@ static void input_start_autorepeat(struct input_dev *dev, int code) | |||
76 | { | 76 | { |
77 | if (test_bit(EV_REP, dev->evbit) && | 77 | if (test_bit(EV_REP, dev->evbit) && |
78 | dev->rep[REP_PERIOD] && dev->rep[REP_DELAY] && | 78 | dev->rep[REP_PERIOD] && dev->rep[REP_DELAY] && |
79 | dev->timer.data) { | 79 | dev->timer.function) { |
80 | dev->repeat_key = code; | 80 | dev->repeat_key = code; |
81 | mod_timer(&dev->timer, | 81 | mod_timer(&dev->timer, |
82 | jiffies + msecs_to_jiffies(dev->rep[REP_DELAY])); | 82 | jiffies + msecs_to_jiffies(dev->rep[REP_DELAY])); |
@@ -179,9 +179,9 @@ static void input_pass_event(struct input_dev *dev, | |||
179 | * dev->event_lock here to avoid racing with input_event | 179 | * dev->event_lock here to avoid racing with input_event |
180 | * which may cause keys get "stuck". | 180 | * which may cause keys get "stuck". |
181 | */ | 181 | */ |
182 | static void input_repeat_key(unsigned long data) | 182 | static void input_repeat_key(struct timer_list *t) |
183 | { | 183 | { |
184 | struct input_dev *dev = (void *) data; | 184 | struct input_dev *dev = from_timer(dev, t, timer); |
185 | unsigned long flags; | 185 | unsigned long flags; |
186 | 186 | ||
187 | spin_lock_irqsave(&dev->event_lock, flags); | 187 | spin_lock_irqsave(&dev->event_lock, flags); |
@@ -1784,7 +1784,7 @@ struct input_dev *input_allocate_device(void) | |||
1784 | device_initialize(&dev->dev); | 1784 | device_initialize(&dev->dev); |
1785 | mutex_init(&dev->mutex); | 1785 | mutex_init(&dev->mutex); |
1786 | spin_lock_init(&dev->event_lock); | 1786 | spin_lock_init(&dev->event_lock); |
1787 | init_timer(&dev->timer); | 1787 | timer_setup(&dev->timer, NULL, 0); |
1788 | INIT_LIST_HEAD(&dev->h_list); | 1788 | INIT_LIST_HEAD(&dev->h_list); |
1789 | INIT_LIST_HEAD(&dev->node); | 1789 | INIT_LIST_HEAD(&dev->node); |
1790 | 1790 | ||
@@ -2047,8 +2047,7 @@ static void devm_input_device_unregister(struct device *dev, void *res) | |||
2047 | */ | 2047 | */ |
2048 | void input_enable_softrepeat(struct input_dev *dev, int delay, int period) | 2048 | void input_enable_softrepeat(struct input_dev *dev, int delay, int period) |
2049 | { | 2049 | { |
2050 | dev->timer.data = (unsigned long) dev; | 2050 | dev->timer.function = (TIMER_FUNC_TYPE)input_repeat_key; |
2051 | dev->timer.function = input_repeat_key; | ||
2052 | dev->rep[REP_DELAY] = delay; | 2051 | dev->rep[REP_DELAY] = delay; |
2053 | dev->rep[REP_PERIOD] = period; | 2052 | dev->rep[REP_PERIOD] = period; |
2054 | } | 2053 | } |