summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-gaff.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-gaff.c')
-rw-r--r--drivers/hid/hid-gaff.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/hid/hid-gaff.c b/drivers/hid/hid-gaff.c
index 0f95c96b70f8..ecbd3995a4eb 100644
--- a/drivers/hid/hid-gaff.c
+++ b/drivers/hid/hid-gaff.c
@@ -64,14 +64,20 @@ static int gaff_init(struct hid_device *hid)
64{ 64{
65 struct gaff_device *gaff; 65 struct gaff_device *gaff;
66 struct hid_report *report; 66 struct hid_report *report;
67 struct hid_input *hidinput = list_entry(hid->inputs.next, 67 struct hid_input *hidinput;
68 struct hid_input, list);
69 struct list_head *report_list = 68 struct list_head *report_list =
70 &hid->report_enum[HID_OUTPUT_REPORT].report_list; 69 &hid->report_enum[HID_OUTPUT_REPORT].report_list;
71 struct list_head *report_ptr = report_list; 70 struct list_head *report_ptr = report_list;
72 struct input_dev *dev = hidinput->input; 71 struct input_dev *dev;
73 int error; 72 int error;
74 73
74 if (list_empty(&hid->inputs)) {
75 hid_err(hid, "no inputs found\n");
76 return -ENODEV;
77 }
78 hidinput = list_entry(hid->inputs.next, struct hid_input, list);
79 dev = hidinput->input;
80
75 if (list_empty(report_list)) { 81 if (list_empty(report_list)) {
76 hid_err(hid, "no output reports found\n"); 82 hid_err(hid, "no output reports found\n");
77 return -ENODEV; 83 return -ENODEV;