summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-emsff.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-emsff.c')
-rw-r--r--drivers/hid/hid-emsff.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/hid/hid-emsff.c b/drivers/hid/hid-emsff.c
index 7cd5651872d3..c34f2e5a049f 100644
--- a/drivers/hid/hid-emsff.c
+++ b/drivers/hid/hid-emsff.c
@@ -47,13 +47,19 @@ static int emsff_init(struct hid_device *hid)
47{ 47{
48 struct emsff_device *emsff; 48 struct emsff_device *emsff;
49 struct hid_report *report; 49 struct hid_report *report;
50 struct hid_input *hidinput = list_first_entry(&hid->inputs, 50 struct hid_input *hidinput;
51 struct hid_input, list);
52 struct list_head *report_list = 51 struct list_head *report_list =
53 &hid->report_enum[HID_OUTPUT_REPORT].report_list; 52 &hid->report_enum[HID_OUTPUT_REPORT].report_list;
54 struct input_dev *dev = hidinput->input; 53 struct input_dev *dev;
55 int error; 54 int error;
56 55
56 if (list_empty(&hid->inputs)) {
57 hid_err(hid, "no inputs found\n");
58 return -ENODEV;
59 }
60 hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
61 dev = hidinput->input;
62
57 if (list_empty(report_list)) { 63 if (list_empty(report_list)) {
58 hid_err(hid, "no output reports found\n"); 64 hid_err(hid, "no output reports found\n");
59 return -ENODEV; 65 return -ENODEV;