aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-logitech-dj.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-logitech-dj.c')
-rw-r--r--drivers/hid/hid-logitech-dj.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index cd33084c7860..7800b1410562 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -619,7 +619,7 @@ static int logi_dj_ll_input_event(struct input_dev *dev, unsigned int type,
619 619
620 struct hid_field *field; 620 struct hid_field *field;
621 struct hid_report *report; 621 struct hid_report *report;
622 unsigned char data[8]; 622 unsigned char *data;
623 int offset; 623 int offset;
624 624
625 dbg_hid("%s: %s, type:%d | code:%d | value:%d\n", 625 dbg_hid("%s: %s, type:%d | code:%d | value:%d\n",
@@ -635,6 +635,13 @@ static int logi_dj_ll_input_event(struct input_dev *dev, unsigned int type,
635 return -1; 635 return -1;
636 } 636 }
637 hid_set_field(field, offset, value); 637 hid_set_field(field, offset, value);
638
639 data = hid_alloc_report_buf(field->report, GFP_ATOMIC);
640 if (!data) {
641 dev_warn(&dev->dev, "failed to allocate report buf memory\n");
642 return -1;
643 }
644
638 hid_output_report(field->report, &data[0]); 645 hid_output_report(field->report, &data[0]);
639 646
640 output_report_enum = &dj_rcv_hiddev->report_enum[HID_OUTPUT_REPORT]; 647 output_report_enum = &dj_rcv_hiddev->report_enum[HID_OUTPUT_REPORT];
@@ -645,8 +652,9 @@ static int logi_dj_ll_input_event(struct input_dev *dev, unsigned int type,
645 652
646 hid_hw_request(dj_rcv_hiddev, report, HID_REQ_SET_REPORT); 653 hid_hw_request(dj_rcv_hiddev, report, HID_REQ_SET_REPORT);
647 654
648 return 0; 655 kfree(data);
649 656
657 return 0;
650} 658}
651 659
652static int logi_dj_ll_start(struct hid_device *hid) 660static int logi_dj_ll_start(struct hid_device *hid)
@@ -801,10 +809,10 @@ static int logi_dj_probe(struct hid_device *hdev,
801 } 809 }
802 810
803 /* This is enabling the polling urb on the IN endpoint */ 811 /* This is enabling the polling urb on the IN endpoint */
804 retval = hdev->ll_driver->open(hdev); 812 retval = hid_hw_open(hdev);
805 if (retval < 0) { 813 if (retval < 0) {
806 dev_err(&hdev->dev, "%s:hdev->ll_driver->open returned " 814 dev_err(&hdev->dev, "%s:hid_hw_open returned error:%d\n",
807 "error:%d\n", __func__, retval); 815 __func__, retval);
808 goto llopen_failed; 816 goto llopen_failed;
809 } 817 }
810 818
@@ -821,7 +829,7 @@ static int logi_dj_probe(struct hid_device *hdev,
821 return retval; 829 return retval;
822 830
823logi_dj_recv_query_paired_devices_failed: 831logi_dj_recv_query_paired_devices_failed:
824 hdev->ll_driver->close(hdev); 832 hid_hw_close(hdev);
825 833
826llopen_failed: 834llopen_failed:
827switch_to_dj_mode_fail: 835switch_to_dj_mode_fail:
@@ -863,7 +871,7 @@ static void logi_dj_remove(struct hid_device *hdev)
863 871
864 cancel_work_sync(&djrcv_dev->work); 872 cancel_work_sync(&djrcv_dev->work);
865 873
866 hdev->ll_driver->close(hdev); 874 hid_hw_close(hdev);
867 hid_hw_stop(hdev); 875 hid_hw_stop(hdev);
868 876
869 /* I suppose that at this point the only context that can access 877 /* I suppose that at this point the only context that can access