]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
HID: rmi: Use hid_report_len to compute the size of reports
authorAndrew Duggan <aduggan@synaptics.com>
Thu, 8 Jan 2015 22:51:36 +0000 (14:51 -0800)
committerJiri Kosina <jkosina@suse.cz>
Mon, 12 Jan 2015 09:11:59 +0000 (10:11 +0100)
Now that hid_report_len is in hid.h we can use this function instead of
duplicating the code which computes it.

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-rmi.c

index 018f80f5fec6f3b1192c960fb6169c5bd902d23c..6270d2cbdb08d17b08a5288eeaa3a1495dfbc091 100644 (file)
@@ -1007,7 +1007,7 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
                goto start;
        }
 
-       data->input_report_size = (input_report->size >> 3) + 1 /* report id */;
+       data->input_report_size = hid_report_len(input_report);
 
        if (!rmi_check_valid_report_id(hdev, HID_OUTPUT_REPORT,
            RMI_WRITE_REPORT_ID, &output_report)) {
@@ -1016,8 +1016,7 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
                goto start;
        }
 
-       data->output_report_size = (output_report->size >> 3)
-                                       + 1 /* report id */;
+       data->output_report_size = hid_report_len(output_report);
 
        data->device_flags |= RMI_DEVICE;
        alloc_size = data->output_report_size + data->input_report_size;