diff options
Diffstat (limited to 'drivers/hid/hid-lgff.c')
-rw-r--r-- | drivers/hid/hid-lgff.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/hid/hid-lgff.c b/drivers/hid/hid-lgff.c index d7ea8c845b40..e1394af0ae7b 100644 --- a/drivers/hid/hid-lgff.c +++ b/drivers/hid/hid-lgff.c | |||
@@ -128,27 +128,14 @@ static void hid_lgff_set_autocenter(struct input_dev *dev, u16 magnitude) | |||
128 | int lgff_init(struct hid_device* hid) | 128 | int lgff_init(struct hid_device* hid) |
129 | { | 129 | { |
130 | struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); | 130 | struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); |
131 | struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; | ||
132 | struct input_dev *dev = hidinput->input; | 131 | struct input_dev *dev = hidinput->input; |
133 | struct hid_report *report; | ||
134 | struct hid_field *field; | ||
135 | const signed short *ff_bits = ff_joystick; | 132 | const signed short *ff_bits = ff_joystick; |
136 | int error; | 133 | int error; |
137 | int i; | 134 | int i; |
138 | 135 | ||
139 | /* Find the report to use */ | ||
140 | if (list_empty(report_list)) { | ||
141 | hid_err(hid, "No output report found\n"); | ||
142 | return -1; | ||
143 | } | ||
144 | |||
145 | /* Check that the report looks ok */ | 136 | /* Check that the report looks ok */ |
146 | report = list_entry(report_list->next, struct hid_report, list); | 137 | if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7)) |
147 | field = report->field[0]; | 138 | return -ENODEV; |
148 | if (!field) { | ||
149 | hid_err(hid, "NULL field\n"); | ||
150 | return -1; | ||
151 | } | ||
152 | 139 | ||
153 | for (i = 0; i < ARRAY_SIZE(devices); i++) { | 140 | for (i = 0; i < ARRAY_SIZE(devices); i++) { |
154 | if (dev->id.vendor == devices[i].idVendor && | 141 | if (dev->id.vendor == devices[i].idVendor && |