diff options
Diffstat (limited to 'drivers/hid/hid-input.c')
-rw-r--r-- | drivers/hid/hid-input.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 1f0d49c6feef..e7e8b19a9284 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -350,9 +350,9 @@ static int hidinput_get_battery_property(struct power_supply *psy, | |||
350 | ret = -ENOMEM; | 350 | ret = -ENOMEM; |
351 | break; | 351 | break; |
352 | } | 352 | } |
353 | ret = dev->hid_get_raw_report(dev, dev->battery_report_id, | 353 | ret = hid_hw_raw_request(dev, dev->battery_report_id, buf, 2, |
354 | buf, 2, | 354 | dev->battery_report_type, |
355 | dev->battery_report_type); | 355 | HID_REQ_GET_REPORT); |
356 | 356 | ||
357 | if (ret != 2) { | 357 | if (ret != 2) { |
358 | ret = -ENODATA; | 358 | ret = -ENODATA; |
@@ -1153,7 +1153,7 @@ static void hidinput_led_worker(struct work_struct *work) | |||
1153 | led_work); | 1153 | led_work); |
1154 | struct hid_field *field; | 1154 | struct hid_field *field; |
1155 | struct hid_report *report; | 1155 | struct hid_report *report; |
1156 | int len; | 1156 | int len, ret; |
1157 | __u8 *buf; | 1157 | __u8 *buf; |
1158 | 1158 | ||
1159 | field = hidinput_get_led_field(hid); | 1159 | field = hidinput_get_led_field(hid); |
@@ -1181,13 +1181,16 @@ static void hidinput_led_worker(struct work_struct *work) | |||
1181 | 1181 | ||
1182 | /* fall back to generic raw-output-report */ | 1182 | /* fall back to generic raw-output-report */ |
1183 | len = ((report->size - 1) >> 3) + 1 + (report->id > 0); | 1183 | len = ((report->size - 1) >> 3) + 1 + (report->id > 0); |
1184 | buf = kmalloc(len, GFP_KERNEL); | 1184 | buf = hid_alloc_report_buf(report, GFP_KERNEL); |
1185 | if (!buf) | 1185 | if (!buf) |
1186 | return; | 1186 | return; |
1187 | 1187 | ||
1188 | hid_output_report(report, buf); | 1188 | hid_output_report(report, buf); |
1189 | /* synchronous output report */ | 1189 | /* synchronous output report */ |
1190 | hid->hid_output_raw_report(hid, buf, len, HID_OUTPUT_REPORT); | 1190 | ret = hid_hw_output_report(hid, buf, len); |
1191 | if (ret == -ENOSYS) | ||
1192 | hid_hw_raw_request(hid, report->id, buf, len, HID_OUTPUT_REPORT, | ||
1193 | HID_REQ_SET_REPORT); | ||
1191 | kfree(buf); | 1194 | kfree(buf); |
1192 | } | 1195 | } |
1193 | 1196 | ||
@@ -1266,10 +1269,7 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid) | |||
1266 | } | 1269 | } |
1267 | 1270 | ||
1268 | input_set_drvdata(input_dev, hid); | 1271 | input_set_drvdata(input_dev, hid); |
1269 | if (hid->ll_driver->hidinput_input_event) | 1272 | input_dev->event = hidinput_input_event; |
1270 | input_dev->event = hid->ll_driver->hidinput_input_event; | ||
1271 | else if (hid->ll_driver->request || hid->hid_output_raw_report) | ||
1272 | input_dev->event = hidinput_input_event; | ||
1273 | input_dev->open = hidinput_open; | 1273 | input_dev->open = hidinput_open; |
1274 | input_dev->close = hidinput_close; | 1274 | input_dev->close = hidinput_close; |
1275 | input_dev->setkeycode = hidinput_setkeycode; | 1275 | input_dev->setkeycode = hidinput_setkeycode; |