[v1,03/19] hid-ft260: fix i2c driver regression in ft260_raw_event

Message ID 20240210215147.77629-4-michael.zaidman@gmail.com
State New
Headers
Series hid-ft260: Fixes for serial driver patch v4 |

Commit Message

Michael Zaidman Feb. 10, 2024, 9:51 p.m. UTC
  Fix i2c regression in ft260_raw_event introduced by
"[PATCH v4 RESEND] hid-ft260: Add serial driver" patch:
https://lore.kernel.org/all/20231218093153.192268-1-contact@christina-quast.de/

It caused wrong printout per every hid input report:

[21912.237393] ft260 0003:0403:6030.000C: unhandled report 0xde
[21912.247405] ft260 0003:0403:6030.000C: unhandled report 0xde
[21912.249403] ft260 0003:0403:6030.000C: unhandled report 0xd1
[21912.275399] ft260 0003:0403:6030.000C: unhandled report 0xde
[21912.285404] ft260 0003:0403:6030.000C: unhandled report 0xde
[21912.287403] ft260 0003:0403:6030.000C: unhandled report 0xd1
[21912.315406] ft260 0003:0403:6030.000C: unhandled report 0xde
[21912.326390] ft260 0003:0403:6030.000C: unhandled report 0xde
[21912.327402] ft260 0003:0403:6030.000C: unhandled report 0xd1

Signed-off-by: Michael Zaidman <michael.zaidman@gmail.com>
---
 drivers/hid/hid-ft260.c | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/drivers/hid/hid-ft260.c b/drivers/hid/hid-ft260.c
index a67c625c9165..a348f11600c6 100644
--- a/drivers/hid/hid-ft260.c
+++ b/drivers/hid/hid-ft260.c
@@ -1755,6 +1755,8 @@  static int ft260_raw_event(struct hid_device *hdev, struct hid_report *report,
 		if (dev->read_idx == dev->read_len)
 			complete(&dev->wait);
 
+		return 0;
+
 	} else if (xfer->length > FT260_RD_DATA_MAX) {
 		hid_err(hdev, "Received data too long (%d)\n", xfer->length);
 		return -EBADR;