diff options
author | Andrew Duggan <aduggan@synaptics.com> | 2015-01-08 17:51:36 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-01-12 04:11:59 -0500 |
commit | b8aed6ea39a70a9b9b8de9df8655ac36719b4d3b (patch) | |
tree | bf744a038df64b9704638e2b901b53b8f76c747a | |
parent | 2f43de605e700f5aa5cad15e19f8ffe54b1d4c86 (diff) |
HID: rmi: Use hid_report_len to compute the size of reports
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>
-rw-r--r-- | drivers/hid/hid-rmi.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c index 018f80f5fec6..6270d2cbdb08 100644 --- a/drivers/hid/hid-rmi.c +++ b/drivers/hid/hid-rmi.c | |||
@@ -1007,7 +1007,7 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
1007 | goto start; | 1007 | goto start; |
1008 | } | 1008 | } |
1009 | 1009 | ||
1010 | data->input_report_size = (input_report->size >> 3) + 1 /* report id */; | 1010 | data->input_report_size = hid_report_len(input_report); |
1011 | 1011 | ||
1012 | if (!rmi_check_valid_report_id(hdev, HID_OUTPUT_REPORT, | 1012 | if (!rmi_check_valid_report_id(hdev, HID_OUTPUT_REPORT, |
1013 | RMI_WRITE_REPORT_ID, &output_report)) { | 1013 | RMI_WRITE_REPORT_ID, &output_report)) { |
@@ -1016,8 +1016,7 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
1016 | goto start; | 1016 | goto start; |
1017 | } | 1017 | } |
1018 | 1018 | ||
1019 | data->output_report_size = (output_report->size >> 3) | 1019 | data->output_report_size = hid_report_len(output_report); |
1020 | + 1 /* report id */; | ||
1021 | 1020 | ||
1022 | data->device_flags |= RMI_DEVICE; | 1021 | data->device_flags |= RMI_DEVICE; |
1023 | alloc_size = data->output_report_size + data->input_report_size; | 1022 | alloc_size = data->output_report_size + data->input_report_size; |