Skip to content

Commit

Permalink
HID: rmi: Use hid_report_len to compute the size of reports
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Duggan authored and Jiri Kosina committed Jan 12, 2015
1 parent 2f43de6 commit b8aed6e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/hid/hid-rmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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;
Expand Down

0 comments on commit b8aed6e

Please sign in to comment.