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>

authored by Dan Carpenter and committed by Dmitry Torokhov f7a2e302 fbf89f25

+4 -8
+4 -8
drivers/input/touchscreen/tps6507x-ts.c
··· 221 221 222 222 if (poll) { 223 223 schd = queue_delayed_work(tsc->wq, &tsc->work, 224 - tsc->poll_period * HZ / 1000); 224 + msecs_to_jiffies(tsc->poll_period)); 225 225 if (schd) 226 226 tsc->polling = 1; 227 227 else { ··· 326 326 goto err2; 327 327 328 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 331 if (schd) 332 332 tsc->polling = 1; ··· 339 339 return 0; 340 340 341 341 err2: 342 - cancel_delayed_work(&tsc->work); 343 - flush_workqueue(tsc->wq); 342 + cancel_delayed_work_sync(&tsc->work); 344 343 destroy_workqueue(tsc->wq); 345 - tsc->wq = 0; 346 344 input_free_device(input_dev); 347 345 err1: 348 346 kfree(tsc); ··· 358 360 if (!tsc) 359 361 return 0; 360 362 361 - cancel_delayed_work(&tsc->work); 362 - flush_workqueue(tsc->wq); 363 + cancel_delayed_work_sync(&tsc->work); 363 364 destroy_workqueue(tsc->wq); 364 - tsc->wq = 0; 365 365 366 366 input_free_device(input_dev); 367 367