diff options
| author | Michal Malý <madcatxster@devoid-pointer.net> | 2015-02-18 16:49:33 -0500 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2015-02-18 17:49:40 -0500 |
| commit | c1740d13e6ae4f1449e0a85097edf3ece51135ca (patch) | |
| tree | 6e095f5ef5d3ad33bbe8f77a517845d59b279169 | |
| parent | f31a2de3fe3680223a0dc93e484c491cc09473d3 (diff) | |
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 <fengguang.wu@intel.com>
Signed-off-by: Michal Malý <madcatxster@devoid-pointer.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| -rw-r--r-- | drivers/hid/hid-lg4ff.c | 17 |
1 files changed, 9 insertions, 8 deletions
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 | |||
| 569 | 569 | ||
| 570 | static int lg4ff_switch_compatibility_mode(struct hid_device *hid, const struct lg4ff_compat_mode_switch *s) | 570 | static int lg4ff_switch_compatibility_mode(struct hid_device *hid, const struct lg4ff_compat_mode_switch *s) |
| 571 | { | 571 | { |
| 572 | struct usb_device *usbdev = hid_to_usb_dev(hid); | 572 | struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; |
| 573 | struct usbhid_device *usbhid = hid->driver_data; | 573 | struct hid_report *report = list_entry(report_list->next, struct hid_report, list); |
| 574 | __s32 *value = report->field[0]->value; | ||
| 574 | u8 i; | 575 | u8 i; |
| 575 | 576 | ||
| 576 | for (i = 0; i < s->cmd_count; i++) { | 577 | for (i = 0; i < s->cmd_count; i++) { |
| 577 | int xferd, ret; | 578 | u8 j; |
| 578 | u8 data[7]; | ||
| 579 | 579 | ||
| 580 | memcpy(data, s->cmd + (7*i), 7); | 580 | for (j = 0; j < 7; j++) |
| 581 | ret = usb_interrupt_msg(usbdev, usbhid->urbout->pipe, data, 7, &xferd, USB_CTRL_SET_TIMEOUT); | 581 | value[j] = s->cmd[j + (7*i)]; |
| 582 | if (ret) | 582 | |
| 583 | return ret; | 583 | hid_hw_request(hid, report, HID_REQ_SET_REPORT); |
| 584 | } | 584 | } |
| 585 | hid_hw_wait(hid); | ||
| 585 | return 0; | 586 | return 0; |
| 586 | } | 587 | } |
| 587 | 588 | ||
