summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2016-09-14 21:38:19 +0300
committerJiri Kosina <jkosina@suse.cz>2016-09-19 14:32:24 +0200
commit6e0263346321372e5494d0e5d74a700b0829776d (patch)
treeb70a53541ef06eef50bc13c60de94ef75e36f7ba /drivers/hid
parent18e3dfac16ae66209fdb570a429089be1907caa1 (diff)
downloadlinux-6e0263346321372e5494d0e5d74a700b0829776d.tar.gz
linux-6e0263346321372e5494d0e5d74a700b0829776d.tar.bz2
linux-6e0263346321372e5494d0e5d74a700b0829776d.zip
HID: uclogic: Override constant descriptors
Make uclogic_report_fixup override constant descriptors with generated descriptors, so models reusing product ID, but working with generated descriptor get correct one. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-uclogic.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/hid/hid-uclogic.c b/drivers/hid/hid-uclogic.c
index 72778b34046e..64abd8d73125 100644
--- a/drivers/hid/hid-uclogic.c
+++ b/drivers/hid/hid-uclogic.c
@@ -632,6 +632,12 @@ static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc,
__u8 iface_num = iface->cur_altsetting->desc.bInterfaceNumber;
struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
+ if (drvdata->rdesc != NULL) {
+ rdesc = drvdata->rdesc;
+ *rsize = drvdata->rsize;
+ return rdesc;
+ }
+
switch (hdev->product) {
case USB_DEVICE_ID_UCLOGIC_TABLET_PF1209:
if (*rsize == PF1209_RDESC_ORIG_SIZE) {
@@ -701,11 +707,6 @@ static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc,
break;
}
break;
- default:
- if (drvdata->rdesc != NULL) {
- rdesc = drvdata->rdesc;
- *rsize = drvdata->rsize;
- }
}
return rdesc;