Commit c1740d13 authored by Michal Malý's avatar Michal Malý Committed by Jiri Kosina

HID: hid-lg4ff: Fix "undefined reference" build issue with CONFIG_USB disabled

Fix "undefined reference" build issue with CONFIG_USB disabled; make the
driver use generic HID API instead.
Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: default avatarMichal Malý <madcatxster@devoid-pointer.net>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent f31a2de3
...@@ -569,19 +569,20 @@ static const struct lg4ff_compat_mode_switch *lg4ff_get_mode_switch_command(cons ...@@ -569,19 +569,20 @@ static const struct lg4ff_compat_mode_switch *lg4ff_get_mode_switch_command(cons
static int lg4ff_switch_compatibility_mode(struct hid_device *hid, const struct lg4ff_compat_mode_switch *s) static int lg4ff_switch_compatibility_mode(struct hid_device *hid, const struct lg4ff_compat_mode_switch *s)
{ {
struct usb_device *usbdev = hid_to_usb_dev(hid); struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list;
struct usbhid_device *usbhid = hid->driver_data; struct hid_report *report = list_entry(report_list->next, struct hid_report, list);
__s32 *value = report->field[0]->value;
u8 i; u8 i;
for (i = 0; i < s->cmd_count; i++) { for (i = 0; i < s->cmd_count; i++) {
int xferd, ret; u8 j;
u8 data[7];
memcpy(data, s->cmd + (7*i), 7); for (j = 0; j < 7; j++)
ret = usb_interrupt_msg(usbdev, usbhid->urbout->pipe, data, 7, &xferd, USB_CTRL_SET_TIMEOUT); value[j] = s->cmd[j + (7*i)];
if (ret)
return ret; hid_hw_request(hid, report, HID_REQ_SET_REPORT);
} }
hid_hw_wait(hid);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment