summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-uclogic-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-uclogic-core.c')
-rw-r--r--drivers/hid/hid-uclogic-core.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/hid/hid-uclogic-core.c b/drivers/hid/hid-uclogic-core.c
index 7092f86517a5..a02edeb30a35 100644
--- a/drivers/hid/hid-uclogic-core.c
+++ b/drivers/hid/hid-uclogic-core.c
@@ -365,9 +365,12 @@ static int uclogic_raw_event(struct hid_device *hdev,
ARRAY_SIZE(params->pen.subreport_list);
/* Try to match a subreport */
for (subreport = params->pen.subreport_list;
- subreport < subreport_list_end &&
- (data[1] & subreport->mask) != subreport->mask;
- subreport++);
+ subreport < subreport_list_end; subreport++) {
+ if (subreport->value != 0 &&
+ subreport->value == data[1]) {
+ break;
+ }
+ }
/* If a subreport matched */
if (subreport < subreport_list_end) {
/* Change to subreport ID, and restart */