aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorSven Van Asbroeck <TheSven73@gmail.com>2019-02-17 01:53:27 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2019-02-17 01:57:31 -0500
commit43bcd820bd61859f5d4f6d9e7da4210ab4fcf448 (patch)
treea325e2ee9f37787f5a6bf032c4ad7a27c6cd1ca1 /drivers/input
parent4e116e93f4fbd1b5f0e800d312d62d1917370d1a (diff)
Input: synaptics_i2c - remove redundant spinlock
Remove a leftover spinlock. This was required back when mod_delayed_work() did not exist, and had to be implemented with a cancel + queue. See commit e7c2f967445d ("workqueue: use mod_delayed_work() instead of __cancel + queue") schedule_delayed_work() and mod_delayed_work() can now be used concurrently. So the spinlock is no longer needed. Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/mouse/synaptics_i2c.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/input/mouse/synaptics_i2c.c b/drivers/input/mouse/synaptics_i2c.c
index 8538318d332c..fa304648d611 100644
--- a/drivers/input/mouse/synaptics_i2c.c
+++ b/drivers/input/mouse/synaptics_i2c.c
@@ -219,7 +219,6 @@ struct synaptics_i2c {
219 struct i2c_client *client; 219 struct i2c_client *client;
220 struct input_dev *input; 220 struct input_dev *input;
221 struct delayed_work dwork; 221 struct delayed_work dwork;
222 spinlock_t lock;
223 int no_data_count; 222 int no_data_count;
224 int no_decel_param; 223 int no_decel_param;
225 int reduce_report_param; 224 int reduce_report_param;
@@ -369,23 +368,11 @@ static bool synaptics_i2c_get_input(struct synaptics_i2c *touch)
369 return xy_delta || gesture; 368 return xy_delta || gesture;
370} 369}
371 370
372static void synaptics_i2c_reschedule_work(struct synaptics_i2c *touch,
373 unsigned long delay)
374{
375 unsigned long flags;
376
377 spin_lock_irqsave(&touch->lock, flags);
378
379 mod_delayed_work(system_wq, &touch->dwork, delay);
380
381 spin_unlock_irqrestore(&touch->lock, flags);
382}
383
384static irqreturn_t synaptics_i2c_irq(int irq, void *dev_id) 371static irqreturn_t synaptics_i2c_irq(int irq, void *dev_id)
385{ 372{
386 struct synaptics_i2c *touch = dev_id; 373 struct synaptics_i2c *touch = dev_id;
387 374
388 synaptics_i2c_reschedule_work(touch, 0); 375 mod_delayed_work(system_wq, &touch->dwork, 0);
389 376
390 return IRQ_HANDLED; 377 return IRQ_HANDLED;
391} 378}
@@ -461,7 +448,7 @@ static void synaptics_i2c_work_handler(struct work_struct *work)
461 * We poll the device once in THREAD_IRQ_SLEEP_SECS and 448 * We poll the device once in THREAD_IRQ_SLEEP_SECS and
462 * if error is detected, we try to reset and reconfigure the touchpad. 449 * if error is detected, we try to reset and reconfigure the touchpad.
463 */ 450 */
464 synaptics_i2c_reschedule_work(touch, delay); 451 mod_delayed_work(system_wq, &touch->dwork, delay);
465} 452}
466 453
467static int synaptics_i2c_open(struct input_dev *input) 454static int synaptics_i2c_open(struct input_dev *input)
@@ -474,7 +461,7 @@ static int synaptics_i2c_open(struct input_dev *input)
474 return ret; 461 return ret;
475 462
476 if (polling_req) 463 if (polling_req)
477 synaptics_i2c_reschedule_work(touch, 464 mod_delayed_work(system_wq, &touch->dwork,
478 msecs_to_jiffies(NO_DATA_SLEEP_MSECS)); 465 msecs_to_jiffies(NO_DATA_SLEEP_MSECS));
479 466
480 return 0; 467 return 0;
@@ -530,7 +517,6 @@ static struct synaptics_i2c *synaptics_i2c_touch_create(struct i2c_client *clien
530 touch->scan_rate_param = scan_rate; 517 touch->scan_rate_param = scan_rate;
531 set_scan_rate(touch, scan_rate); 518 set_scan_rate(touch, scan_rate);
532 INIT_DELAYED_WORK(&touch->dwork, synaptics_i2c_work_handler); 519 INIT_DELAYED_WORK(&touch->dwork, synaptics_i2c_work_handler);
533 spin_lock_init(&touch->lock);
534 520
535 return touch; 521 return touch;
536} 522}
@@ -637,7 +623,7 @@ static int __maybe_unused synaptics_i2c_resume(struct device *dev)
637 if (ret) 623 if (ret)
638 return ret; 624 return ret;
639 625
640 synaptics_i2c_reschedule_work(touch, 626 mod_delayed_work(system_wq, &touch->dwork,
641 msecs_to_jiffies(NO_DATA_SLEEP_MSECS)); 627 msecs_to_jiffies(NO_DATA_SLEEP_MSECS));
642 628
643 return 0; 629 return 0;