Skip to content

Commit

Permalink
Merge branch 'for-3.9/upstream-fixes' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
torvalds committed Mar 8, 2013
2 parents c77f8bf + dcd9006 commit d381f45
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions drivers/hid/hid-logitech-dj.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -459,19 +459,25 @@ static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev,
struct dj_report *dj_report) struct dj_report *dj_report)
{ {
struct hid_device *hdev = djrcv_dev->hdev; struct hid_device *hdev = djrcv_dev->hdev;
int sent_bytes; struct hid_report *report;
struct hid_report_enum *output_report_enum;
u8 *data = (u8 *)(&dj_report->device_index);
int i;


if (!hdev->hid_output_raw_report) { output_report_enum = &hdev->report_enum[HID_OUTPUT_REPORT];
dev_err(&hdev->dev, "%s:" report = output_report_enum->report_id_hash[REPORT_ID_DJ_SHORT];
"hid_output_raw_report is null\n", __func__);
if (!report) {
dev_err(&hdev->dev, "%s: unable to find dj report\n", __func__);
return -ENODEV; return -ENODEV;
} }


sent_bytes = hdev->hid_output_raw_report(hdev, (u8 *) dj_report, for (i = 0; i < report->field[0]->report_count; i++)
sizeof(struct dj_report), report->field[0]->value[i] = data[i];
HID_OUTPUT_REPORT);
usbhid_submit_report(hdev, report, USB_DIR_OUT);


return (sent_bytes < 0) ? sent_bytes : 0; return 0;
} }


static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev)
Expand Down

0 comments on commit d381f45

Please sign in to comment.