summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-lg2ff.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-25 15:59:04 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-25 15:59:04 (GMT)
commite2aad1d5716c5f7fa5deb4a96e6b6a4e9f24e78b (patch)
tree389fbdf161a3c28c9b2f98fdc1ccd89d474ef884 /drivers/hid/hid-lg2ff.c
parent3ffdea3feca9e2c95c2e93e217d77c9c368f747a (diff)
parent4a10c2ac2f368583138b774ca41fac4207911983 (diff)
downloadlinux-e2aad1d5716c5f7fa5deb4a96e6b6a4e9f24e78b.tar.xz
Merge 3.12-rc2 into staging-next.
This resolves the merge problem with two iio drivers that Stephen Rothwell pointed out. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 b3cd150..1a42eaa 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)