aboutsummaryrefslogtreecommitdiff
path: root/target/linux/bcm27xx/patches-6.1/950-0333-Input-edt-ft54x6-Clean-up-timer-and-workqueue-on-rem.patch
blob: 223da15a192a87f712e3f8264c2175a61abea8fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From 1d2ab2a7cfba5a4298b0d06d05fdc0584c63c6f4 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Wed, 8 Sep 2021 14:46:17 +0100
Subject: [PATCH] Input: edt-ft54x6: Clean up timer and workqueue on
 remove

If no interrupt is defined then a timer and workqueue are used
to poll the controller.
On remove these were not being cleaned up correctly.

Fixes: ca61fdaba79f "Input: edt-ft5x06: Poll the device if no interrupt is
configured."

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
 drivers/input/touchscreen/edt-ft5x06.c | 4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -1381,6 +1381,10 @@ static void edt_ft5x06_ts_remove(struct
 {
 	struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
 
+	if (!client->irq) {
+		del_timer(&tsdata->timer);
+		cancel_work_sync(&tsdata->work_i2c_poll);
+	}
 	edt_ft5x06_ts_teardown_debugfs(tsdata);
 }