From: Michal Malý Date: Wed, 18 Feb 2015 21:49:33 +0000 (+0100) Subject: HID: hid-lg4ff: Fix "undefined reference" build issue with CONFIG_USB disabled X-Git-Tag: firefly_0821_release~176^2~1996^2~1^6~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c1740d13e6ae4f1449e0a85097edf3ece51135ca;p=firefly-linux-kernel-4.4.55.git 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: kbuild test robot Signed-off-by: Michal Malý Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 854982be3194..1232210b1cc5 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c @@ -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) { - struct usb_device *usbdev = hid_to_usb_dev(hid); - struct usbhid_device *usbhid = hid->driver_data; + struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; + struct hid_report *report = list_entry(report_list->next, struct hid_report, list); + __s32 *value = report->field[0]->value; u8 i; for (i = 0; i < s->cmd_count; i++) { - int xferd, ret; - u8 data[7]; + u8 j; - memcpy(data, s->cmd + (7*i), 7); - ret = usb_interrupt_msg(usbdev, usbhid->urbout->pipe, data, 7, &xferd, USB_CTRL_SET_TIMEOUT); - if (ret) - return ret; + for (j = 0; j < 7; j++) + value[j] = s->cmd[j + (7*i)]; + + hid_hw_request(hid, report, HID_REQ_SET_REPORT); } + hid_hw_wait(hid); return 0; }