HID: Use hid_parser for pre-scanning the report descriptors
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Thu, 22 Aug 2013 12:51:07 +0000 (14:51 +0200)
committerJiri Kosina <jkosina@suse.cz>
Tue, 27 Aug 2013 08:00:00 +0000 (10:00 +0200)
commit3dc8fc083dbfeede7b63a0c07581192e97711365
tree0d3b7b292e7029503f45a9db17a752726c603cb1
parentc08d46aa805ba46d501f610c2448d07bea979780
HID: Use hid_parser for pre-scanning the report descriptors

The Win 8 detection is sufficiently complex to warrant use of the full
parser code, in spite of the inferred memory usage. Therefore, we can use
the existing HID parser in hid-core for hid_scan_report() by re-using the
code from hid_open_report(). hid_parser_global, hid_parser_local and
hid_parser_reserved does not have any side effects. We just need to
reimplement the MAIN_ITEM callback to have a proper parsing without side
effects.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
Tested-by: Srinivas Pandruvada<srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-core.c