Commit 41214ce6 authored by David Fries's avatar David Fries Committed by Greg Kroah-Hartman

[PATCH] USB: fix for HID field index

The problem I'm having is that the field index is always returned as 0
when reading struct hiddev_usage_ref and I need something to
distinguish the input data as the usage code is the same.  I looked
through hid-core.c and hiddev.c and hiddev_hid_event is the only place
I could see field->index being used.  It wasn't being initialized
causing the input to always be returned as zero.
Signed-off-by: default avatarDavid Fries <dfries@mail.win.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 5a3d4263
......@@ -94,7 +94,8 @@ static struct hid_field *hid_register_field(struct hid_report *report, unsigned
memset(field, 0, sizeof(struct hid_field) + usages * sizeof(struct hid_usage)
+ values * sizeof(unsigned));
report->field[report->maxfield++] = field;
field->index = report->maxfield++;
report->field[field->index] = field;
field->usage = (struct hid_usage *)(field + 1);
field->value = (unsigned *)(field->usage + usages);
field->report = report;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment