HID: core: split data fetching from processing in hid_input_field()

This is a preparatory patch for being able to process the usages
out of order. We split the retrieval of the data in a separate function
and also split out the processing of the usages depending if the field
is an array or a variable.

No functional changes from this patch.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Benjamin Tissoires
2022-02-03 15:32:17 +01:00
committed by Jiri Kosina
parent 74acc277b6
commit b79c1abae5
2 changed files with 80 additions and 21 deletions

View File

@@ -342,7 +342,7 @@ struct hid_item {
* HID device quirks.
*/
/*
/*
* Increase this if you need to configure more HID quirks at module load time
*/
#define MAX_USBHID_BOOT_QUIRKS 4
@@ -483,6 +483,7 @@ struct hid_field {
__s32 physical_maximum;
__s32 unit_exponent;
unsigned unit;
bool ignored; /* this field is ignored in this event */
struct hid_report *report; /* associated report */
unsigned index; /* index into report->field[] */
/* hidinput data */