Skip to content

Commit

Permalink
HID: input: hid-input remove hid_output_raw_report call
Browse files Browse the repository at this point in the history
hid_output_raw_report() is not a ll_driver callback and should not be used.
To keep the same code path than before, we are forced to play with the
different hid_hw_* calls: if the usb or i2c device does not support
direct output reports, then we will rely on the SET_REPORT HID call.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed Feb 24, 2014
1 parent 5318251 commit 2ebaebc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/hid/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ static void hidinput_led_worker(struct work_struct *work)
led_work);
struct hid_field *field;
struct hid_report *report;
int len;
int len, ret;
__u8 *buf;

field = hidinput_get_led_field(hid);
Expand Down Expand Up @@ -1184,7 +1184,10 @@ static void hidinput_led_worker(struct work_struct *work)

hid_output_report(report, buf);
/* synchronous output report */
hid_output_raw_report(hid, buf, len, HID_OUTPUT_REPORT);
ret = hid_hw_output_report(hid, buf, len);
if (ret == -ENOSYS)
hid_hw_raw_request(hid, report->id, buf, len, HID_OUTPUT_REPORT,
HID_REQ_SET_REPORT);
kfree(buf);
}

Expand Down Expand Up @@ -1263,7 +1266,8 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid)
}

input_set_drvdata(input_dev, hid);
if (hid->ll_driver->request || hid->hid_output_raw_report)
if (hid->ll_driver->request || hid->ll_driver->output_report ||
hid->ll_driver->raw_request)
input_dev->event = hidinput_input_event;
input_dev->open = hidinput_open;
input_dev->close = hidinput_close;
Expand Down

0 comments on commit 2ebaebc

Please sign in to comment.