Commit f7a2e302 authored by Dan Carpenter's avatar Dan Carpenter Committed by Dmitry Torokhov

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: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent fbf89f25
...@@ -221,7 +221,7 @@ static void tps6507x_ts_handler(struct work_struct *work) ...@@ -221,7 +221,7 @@ static void tps6507x_ts_handler(struct work_struct *work)
if (poll) { if (poll) {
schd = queue_delayed_work(tsc->wq, &tsc->work, schd = queue_delayed_work(tsc->wq, &tsc->work,
tsc->poll_period * HZ / 1000); msecs_to_jiffies(tsc->poll_period));
if (schd) if (schd)
tsc->polling = 1; tsc->polling = 1;
else { else {
...@@ -326,7 +326,7 @@ static int tps6507x_ts_probe(struct platform_device *pdev) ...@@ -326,7 +326,7 @@ static int tps6507x_ts_probe(struct platform_device *pdev)
goto err2; goto err2;
schd = queue_delayed_work(tsc->wq, &tsc->work, schd = queue_delayed_work(tsc->wq, &tsc->work,
tsc->poll_period * HZ / 1000); msecs_to_jiffies(tsc->poll_period));
if (schd) if (schd)
tsc->polling = 1; tsc->polling = 1;
...@@ -339,10 +339,8 @@ static int tps6507x_ts_probe(struct platform_device *pdev) ...@@ -339,10 +339,8 @@ static int tps6507x_ts_probe(struct platform_device *pdev)
return 0; return 0;
err2: err2:
cancel_delayed_work(&tsc->work); cancel_delayed_work_sync(&tsc->work);
flush_workqueue(tsc->wq);
destroy_workqueue(tsc->wq); destroy_workqueue(tsc->wq);
tsc->wq = 0;
input_free_device(input_dev); input_free_device(input_dev);
err1: err1:
kfree(tsc); kfree(tsc);
...@@ -360,10 +358,8 @@ static int __devexit tps6507x_ts_remove(struct platform_device *pdev) ...@@ -360,10 +358,8 @@ static int __devexit tps6507x_ts_remove(struct platform_device *pdev)
if (!tsc) if (!tsc)
return 0; return 0;
cancel_delayed_work(&tsc->work); cancel_delayed_work_sync(&tsc->work);
flush_workqueue(tsc->wq);
destroy_workqueue(tsc->wq); destroy_workqueue(tsc->wq);
tsc->wq = 0;
input_free_device(input_dev); input_free_device(input_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment