aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-06-02 00:29:40 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-06-02 03:11:18 -0400
commitf7a2e30246281944064113dafbafe3eb14cd89e3 (patch)
treef2cfc0b01334ca058be14550afb001521f3fefe6 /drivers/input/touchscreen
parentfbf89f25fc4dc68ba0857aca87e70fa5d2592d81 (diff)
Input: tps6507x-ts - a couple work queue cleanups
1) Use msecs_to_jiffies() instead of calculating by hand. 2) Call cancel_delayed_work_sync() instead of cancel_delayed_work() followed by a separate flush_workqueue(). 3) Remove the "tsc->wq = 0;" Sparse complains about that because tsc->wq is a pointer, not an int. It's not needed because we just free the pointer anyway. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/tps6507x-ts.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c
index 5de80a1a730..5b70a1419b4 100644
--- a/drivers/input/touchscreen/tps6507x-ts.c
+++ b/drivers/input/touchscreen/tps6507x-ts.c
@@ -221,7 +221,7 @@ done:
221 221
222 if (poll) { 222 if (poll) {
223 schd = queue_delayed_work(tsc->wq, &tsc->work, 223 schd = queue_delayed_work(tsc->wq, &tsc->work,
224 tsc->poll_period * HZ / 1000); 224 msecs_to_jiffies(tsc->poll_period));
225 if (schd) 225 if (schd)
226 tsc->polling = 1; 226 tsc->polling = 1;
227 else { 227 else {
@@ -326,7 +326,7 @@ static int tps6507x_ts_probe(struct platform_device *pdev)
326 goto err2; 326 goto err2;
327 327
328 schd = queue_delayed_work(tsc->wq, &tsc->work, 328 schd = queue_delayed_work(tsc->wq, &tsc->work,
329 tsc->poll_period * HZ / 1000); 329 msecs_to_jiffies(tsc->poll_period));
330 330
331 if (schd) 331 if (schd)
332 tsc->polling = 1; 332 tsc->polling = 1;
@@ -339,10 +339,8 @@ static int tps6507x_ts_probe(struct platform_device *pdev)
339 return 0; 339 return 0;
340 340
341err2: 341err2:
342 cancel_delayed_work(&tsc->work); 342 cancel_delayed_work_sync(&tsc->work);
343 flush_workqueue(tsc->wq);
344 destroy_workqueue(tsc->wq); 343 destroy_workqueue(tsc->wq);
345 tsc->wq = 0;
346 input_free_device(input_dev); 344 input_free_device(input_dev);
347err1: 345err1:
348 kfree(tsc); 346 kfree(tsc);
@@ -360,10 +358,8 @@ static int __devexit tps6507x_ts_remove(struct platform_device *pdev)
360 if (!tsc) 358 if (!tsc)
361 return 0; 359 return 0;
362 360
363 cancel_delayed_work(&tsc->work); 361 cancel_delayed_work_sync(&tsc->work);
364 flush_workqueue(tsc->wq);
365 destroy_workqueue(tsc->wq); 362 destroy_workqueue(tsc->wq);
366 tsc->wq = 0;
367 363
368 input_free_device(input_dev); 364 input_free_device(input_dev);
369 365