aboutsummaryrefslogtreecommitdiff
path: root/drivers/hid/hid-lg2ff.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-10-04 00:30:17 +0100
committerMark Brown <broonie@linaro.org>2013-10-04 00:30:17 +0100
commit18d8ff256f495bee7bcf016d9006d4b330e29260 (patch)
treee3d01967862b312711e27bd790c57e20c723d0c1 /drivers/hid/hid-lg2ff.c
parent2a0458773656240cf6fa97f1126c92dcddf8ab90 (diff)
parent8c15abc94c737f9120d3d4a550abbcbb9be121f6 (diff)
Merge tag 'v3.10.14' into linux-linaro-lsk
This is the 3.10.14 stable release
Diffstat (limited to 'drivers/hid/hid-lg2ff.c')
-rw-r--r--drivers/hid/hid-lg2ff.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/hid/hid-lg2ff.c b/drivers/hid/hid-lg2ff.c
index b3cd1507dda..1a42eaa6ca0 100644
--- a/drivers/hid/hid-lg2ff.c
+++ b/drivers/hid/hid-lg2ff.c
@@ -64,26 +64,13 @@ int lg2ff_init(struct hid_device *hid)
struct hid_report *report;
struct hid_input *hidinput = list_entry(hid->inputs.next,
struct hid_input, list);
- struct list_head *report_list =
- &hid->report_enum[HID_OUTPUT_REPORT].report_list;
struct input_dev *dev = hidinput->input;
int error;
- if (list_empty(report_list)) {
- hid_err(hid, "no output report found\n");
+ /* Check that the report looks ok */
+ report = hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7);
+ if (!report)
return -ENODEV;
- }
-
- report = list_entry(report_list->next, struct hid_report, list);
-
- if (report->maxfield < 1) {
- hid_err(hid, "output report is empty\n");
- return -ENODEV;
- }
- if (report->field[0]->report_count < 7) {
- hid_err(hid, "not enough values in the field\n");
- return -ENODEV;
- }
lg2ff = kmalloc(sizeof(struct lg2ff_device), GFP_KERNEL);
if (!lg2ff)