aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2015-10-07 19:54:22 -0400
committerJiri Kosina <jkosina@suse.cz>2015-10-21 07:13:12 -0400
commitdf7079380554e6e8e13a0812c7e6c72f669aba5c (patch)
treec9f89bc0571cb94db2268da6836ccb11278f7ca8
parent499522c8c015de995aabce3d0f0bf4b9b17f44c3 (diff)
HID: wacom: Expect 'touch_max' touches if HID_DG_CONTACTCOUNT not present
When introduced in commit 1b5d514, the check 'if (hid_data->cc_index >= 0)' in 'wacom_wac_finger_pre_report' was intended to switch where the driver got the expected number of contacts from: HID_DG_CONTACTCOUNT if the usage was present, or 'touch_max' otherwise. Unfortunately, an oversight worthy of a brown paper bag (specifically, that 'cc_index' could never be negative) meant that the latter 'else' clause would never be entered. The patch prior to this one introduced a way for 'cc_index' to be negative, but only if HID_DG_CONTACTCOUNT is present in some report _other_ than the one being processed. To ensure the 'else' clause is also entered for devices which don't have HID_DG_CONTACTCOUNT on _any_ report, we add the additional constraint that 'cc_report' be non-zero (which is true only if the usage is present in some report). Cc: stable@vger.kernel.org Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/wacom_wac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 9c3b14496c97..cba008ac9cff 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -1740,8 +1740,8 @@ static void wacom_wac_finger_pre_report(struct hid_device *hdev,
1740 } 1740 }
1741 } 1741 }
1742 } 1742 }
1743 1743 if (hid_data->cc_report != 0 &&
1744 if (hid_data->cc_index >= 0) { 1744 hid_data->cc_index >= 0) {
1745 struct hid_field *field = report->field[hid_data->cc_index]; 1745 struct hid_field *field = report->field[hid_data->cc_index];
1746 int value = field->value[hid_data->cc_value_index]; 1746 int value = field->value[hid_data->cc_value_index];
1747 if (value) 1747 if (value)