Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Benjamin Tissoires and committed by
Jiri Kosina
2ebaebcf 53182517

+7 -3
+7 -3
drivers/hid/hid-input.c
··· 1150 1150 led_work); 1151 1151 struct hid_field *field; 1152 1152 struct hid_report *report; 1153 - int len; 1153 + int len, ret; 1154 1154 __u8 *buf; 1155 1155 1156 1156 field = hidinput_get_led_field(hid); ··· 1184 1184 1185 1185 hid_output_report(report, buf); 1186 1186 /* 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); 1188 1191 kfree(buf); 1189 1192 } 1190 1193 ··· 1266 1263 } 1267 1264 1268 1265 input_set_drvdata(input_dev, hid); 1269 - if (hid->ll_driver->request || hid->hid_output_raw_report) 1266 + if (hid->ll_driver->request || hid->ll_driver->output_report || 1267 + hid->ll_driver->raw_request) 1270 1268 input_dev->event = hidinput_input_event; 1271 1269 input_dev->open = hidinput_open; 1272 1270 input_dev->close = hidinput_close;