ChangeSet 1.2223.2.11, 2004/11/24 15:15:22-08:00, [EMAIL PROTECTED]

[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: David Fries <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>


 drivers/usb/input/hid-core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


diff -Nru a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c      2004-11-30 15:43:43 -08:00
+++ b/drivers/usb/input/hid-core.c      2004-11-30 15:43:43 -08:00
@@ -94,7 +94,8 @@
        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;



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to