summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-cypress.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-10-23 22:49:32 +0200
committerJiri Kosina <jkosina@suse.cz>2010-10-23 22:49:32 +0200
commit8b66a16f25f819bb1f132f075c5c01a288776cf8 (patch)
treeff6e16818194aca66d8ea34f9765067b2a82020a /drivers/hid/hid-cypress.c
parentbbd128b5acae85b2ef346e95cc5a729ac5252f19 (diff)
parent41fa92302be7fa37c5c38e17e2097d3e5e9da13a (diff)
Merge branch 'uc-logic' into for-linus
Conflicts: drivers/hid/hid-ids.h drivers/hid/hid-lg.c drivers/hid/usbhid/hid-quirks.c
Diffstat (limited to 'drivers/hid/hid-cypress.c')
-rw-r--r--drivers/hid/hid-cypress.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/hid/hid-cypress.c b/drivers/hid/hid-cypress.c
index 998b6f443d7..4cd0e234599 100644
--- a/drivers/hid/hid-cypress.c
+++ b/drivers/hid/hid-cypress.c
@@ -31,16 +31,16 @@
* Some USB barcode readers from cypress have usage min and usage max in
* the wrong order
*/
-static void cp_report_fixup(struct hid_device *hdev, __u8 *rdesc,
- unsigned int rsize)
+static __u8 *cp_report_fixup(struct hid_device *hdev, __u8 *rdesc,
+ unsigned int *rsize)
{
unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);
unsigned int i;
if (!(quirks & CP_RDESC_SWAPPED_MIN_MAX))
- return;
+ return rdesc;
- for (i = 0; i < rsize - 4; i++)
+ for (i = 0; i < *rsize - 4; i++)
if (rdesc[i] == 0x29 && rdesc[i + 2] == 0x19) {
__u8 tmp;
@@ -50,6 +50,7 @@ static void cp_report_fixup(struct hid_device *hdev, __u8 *rdesc,
rdesc[i + 3] = rdesc[i + 1];
rdesc[i + 1] = tmp;
}
+ return rdesc;
}
static int cp_input_mapped(struct hid_device *hdev, struct hid_input *hi,