HID: Use hid_parser for pre-scanning the report descriptors
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 <7a0e50e3f6a0939db82b6a8a423c08a163896f41@redhat.com>
Reviewed-by: Henrik Rydberg <b7088a9c70345a9ab94cacab3cc3888d0a7dc884@euromail.se>
Tested-by: Srinivas Pandruvada<910e550f1c830a1d246b6c3ed4d6ca559ba95c19@linux.intel.com>
Signed-off-by: Jiri Kosina <ed58f755cc8caaf10c3e8c731a8b86fb8f13d6cb@suse.cz>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs