0648764965d961dc2551d529d3c46f1ca563df39
[openwrt/staging/blogic.git] /
1 From 55314e9ff8225d0c110e6598d2837baac17a30cd Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 8 Sep 2021 14:46:17 +0100
4 Subject: [PATCH] Input: edt-ft54x6: Clean up timer and workqueue on
5 remove
6
7 If no interrupt is defined then a timer and workqueue are used
8 to poll the controller.
9 On remove these were not being cleaned up correctly.
10
11 Fixes: ca61fdaba79f "Input: edt-ft5x06: Poll the device if no interrupt is
12 configured."
13
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
15 ---
16 drivers/input/touchscreen/edt-ft5x06.c | 4 ++++
17 1 file changed, 4 insertions(+)
18
19 --- a/drivers/input/touchscreen/edt-ft5x06.c
20 +++ b/drivers/input/touchscreen/edt-ft5x06.c
21 @@ -1301,6 +1301,10 @@ static int edt_ft5x06_ts_remove(struct i
22 {
23 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
24
25 + if (!client->irq) {
26 + del_timer(&tsdata->timer);
27 + cancel_work_sync(&tsdata->work_i2c_poll);
28 + }
29 edt_ft5x06_ts_teardown_debugfs(tsdata);
30
31 return 0;