aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-03-08 17:42:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-03-08 17:42:52 -0500
commitd381f45c890a3fb136afb0dc1cbe025e066cb981 (patch)
tree8e2ea5615810671033f55f1619e800b0d05a0055 /drivers/hid
parentc77f8bf918e66711938a25b19b188b24971a7d30 (diff)
parentdcd9006b1b053c7b1cebe81333261d4fd492ffeb (diff)
Merge branch 'for-3.9/upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID fix from Jiri Kosina: "Bugfix for a long-standing bug in logitech-dj driver causing all sorts of random initialization problems, finally debugged by Benjamin Tissoires with help of Bob Bowles." * 'for-3.9/upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: logitech-dj: do not directly call hid_output_raw_report() during probe
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-logitech-dj.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index 9500f2f3f8fe..8758f38c948c 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -459,19 +459,25 @@ static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev,
459 struct dj_report *dj_report) 459 struct dj_report *dj_report)
460{ 460{
461 struct hid_device *hdev = djrcv_dev->hdev; 461 struct hid_device *hdev = djrcv_dev->hdev;
462 int sent_bytes; 462 struct hid_report *report;
463 struct hid_report_enum *output_report_enum;
464 u8 *data = (u8 *)(&dj_report->device_index);
465 int i;
463 466
464 if (!hdev->hid_output_raw_report) { 467 output_report_enum = &hdev->report_enum[HID_OUTPUT_REPORT];
465 dev_err(&hdev->dev, "%s:" 468 report = output_report_enum->report_id_hash[REPORT_ID_DJ_SHORT];
466 "hid_output_raw_report is null\n", __func__); 469
470 if (!report) {
471 dev_err(&hdev->dev, "%s: unable to find dj report\n", __func__);
467 return -ENODEV; 472 return -ENODEV;
468 } 473 }
469 474
470 sent_bytes = hdev->hid_output_raw_report(hdev, (u8 *) dj_report, 475 for (i = 0; i < report->field[0]->report_count; i++)
471 sizeof(struct dj_report), 476 report->field[0]->value[i] = data[i];
472 HID_OUTPUT_REPORT); 477
478 usbhid_submit_report(hdev, report, USB_DIR_OUT);
473 479
474 return (sent_bytes < 0) ? sent_bytes : 0; 480 return 0;
475} 481}
476 482
477static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) 483static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev)