aboutsummaryrefslogtreecommitdiff
path: root/drivers/hid/hid-zpff.c
diff options
context:
space:
mode:
authorIngo Molnar2013-10-03 07:52:21 +0200
committerIngo Molnar2013-10-03 07:52:21 +0200
commit6c09f6d830d03b78717403e7b42838a2ee2987ae (patch)
tree6436ab6a237578406e004c891e134afd266fb95d /drivers/hid/hid-zpff.c
parent389e067032fbb96e439abafae848dd447e4cafb4 (diff)
parent15c03dd4859ab16f9212238f29dd315654aa94f6 (diff)
Merge tag 'v3.12-rc3' into timers/core
Merge Linux 3.12-rc3 - refresh the tree with the latest fixes before merging new bits. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/hid/hid-zpff.c')
-rw-r--r--drivers/hid/hid-zpff.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/hid/hid-zpff.c b/drivers/hid/hid-zpff.c
index 6ec28a37c146..a29756c6ca02 100644
--- a/drivers/hid/hid-zpff.c
+++ b/drivers/hid/hid-zpff.c
@@ -68,21 +68,13 @@ static int zpff_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;
+ int i, error;
- if (list_empty(report_list)) {
- hid_err(hid, "no output report found\n");
- return -ENODEV;
- }
-
- report = list_entry(report_list->next, struct hid_report, list);
-
- if (report->maxfield < 4) {
- hid_err(hid, "not enough fields in report\n");
- return -ENODEV;
+ for (i = 0; i < 4; i++) {
+ report = hid_validate_values(hid, HID_OUTPUT_REPORT, 0, i, 1);
+ if (!report)
+ return -ENODEV;
}
zpff = kzalloc(sizeof(struct zpff_device), GFP_KERNEL);