Skip to content

Commit 2ebaebc

Browse files
bentissJiri Kosina
authored andcommitted
HID: input: hid-input remove hid_output_raw_report call
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>
1 parent 5318251 commit 2ebaebc

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎drivers/hid/hid-input.c‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ static void hidinput_led_worker(struct work_struct *work)
11501150
led_work);
11511151
struct hid_field *field;
11521152
struct hid_report *report;
1153-
int len;
1153+
int len, ret;
11541154
__u8 *buf;
11551155

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

11851185
hid_output_report(report, buf);
11861186
/* synchronous output report */
1187-
hid_output_raw_report(hid, buf, len, HID_OUTPUT_REPORT);
1187+
ret = hid_hw_output_report(hid, buf, len);
1188+
if (ret == -ENOSYS)
1189+
hid_hw_raw_request(hid, report->id, buf, len, HID_OUTPUT_REPORT,
1190+
HID_REQ_SET_REPORT);
11881191
kfree(buf);
11891192
}
11901193

@@ -1263,7 +1266,8 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid)
12631266
}
12641267

12651268
input_set_drvdata(input_dev, hid);
1266-
if (hid->ll_driver->request || hid->hid_output_raw_report)
1269+
if (hid->ll_driver->request || hid->ll_driver->output_report ||
1270+
hid->ll_driver->raw_request)
12671271
input_dev->event = hidinput_input_event;
12681272
input_dev->open = hidinput_open;
12691273
input_dev->close = hidinput_close;

0 commit comments

Comments
 (0)