aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/tps6507x-ts.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/tps6507x-ts.c')
-rw-r--r--drivers/input/touchscreen/tps6507x-ts.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c
index 5de80a1a730..a644d18c04d 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);
@@ -357,13 +355,8 @@ static int __devexit tps6507x_ts_remove(struct platform_device *pdev)
357 struct tps6507x_ts *tsc = tps6507x_dev->ts; 355 struct tps6507x_ts *tsc = tps6507x_dev->ts;
358 struct input_dev *input_dev = tsc->input_dev; 356 struct input_dev *input_dev = tsc->input_dev;
359 357
360 if (!tsc) 358 cancel_delayed_work_sync(&tsc->work);
361 return 0;
362
363 cancel_delayed_work(&tsc->work);
364 flush_workqueue(tsc->wq);
365 destroy_workqueue(tsc->wq); 359 destroy_workqueue(tsc->wq);
366 tsc->wq = 0;
367 360
368 input_free_device(input_dev); 361 input_free_device(input_dev);
369 362