summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-zpff.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-23 13:24:10 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-23 13:24:10 -0700
commitdc4fea795bf7e3f80dbfa3a40b8ab89427e9aed5 (patch)
tree1926c96f145965c393a2c8ab523c327dd1a241cf /drivers/hid/hid-zpff.c
parentc8f2efc8f636506e0f0c2ba4035382076875f0c1 (diff)
parent9d23108df359e572a0dca0b631bfee9f5e0fa9ea (diff)
downloadlinux-next-dc4fea795bf7e3f80dbfa3a40b8ab89427e9aed5.tar.gz
Merge branch 'master' into usb-next
We have USB fixes now in Linus's tree that we need to properly sort out with reverts and the like in the usb-next branch, so merge them together and do it by hand. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.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);