Skip to content

Commit

Permalink
HID: cp2112: remove various hid_out_raw_report calls
Browse files Browse the repository at this point in the history
hid_out_raw_report is going to be obsoleted as it is not part of the
unified HID low level transport documentation
(Documentation/hid/hid-transport.txt)

  hid_output_raw_report(hdev, buf, sizeof(buf), HID_FEATURE_REPORT);
is strictly equivalent to:
  hid_hw_raw_request(hdev, buf[0], buf, sizeof(buf),
		HID_FEATURE_REPORT, HID_REQ_SET_REPORT);

Then replace buf[0] by the appropriate define.

So use the new api.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed Mar 14, 2014
1 parent c16527c commit 293e483
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/hid/hid-cp2112.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ static int cp2112_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
buf[1] &= ~(1 << offset);
buf[2] = gpio_push_pull;

ret = hdev->hid_output_raw_report(hdev, buf, sizeof(buf),
HID_FEATURE_REPORT);
ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, sizeof(buf),
HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
if (ret < 0) {
hid_err(hdev, "error setting GPIO config: %d\n", ret);
return ret;
Expand All @@ -207,8 +207,8 @@ static void cp2112_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
buf[1] = value ? 0xff : 0;
buf[2] = 1 << offset;

ret = hdev->hid_output_raw_report(hdev, buf, sizeof(buf),
HID_FEATURE_REPORT);
ret = hid_hw_raw_request(hdev, CP2112_GPIO_SET, buf, sizeof(buf),
HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
if (ret < 0)
hid_err(hdev, "error setting GPIO values: %d\n", ret);
}
Expand Down Expand Up @@ -253,8 +253,8 @@ static int cp2112_gpio_direction_output(struct gpio_chip *chip,
buf[1] |= 1 << offset;
buf[2] = gpio_push_pull;

ret = hdev->hid_output_raw_report(hdev, buf, sizeof(buf),
HID_FEATURE_REPORT);
ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, sizeof(buf),
HID_FEATURE_REPORT, HID_REQ_SET_REPORT);
if (ret < 0) {
hid_err(hdev, "error setting GPIO config: %d\n", ret);
return ret;
Expand Down

0 comments on commit 293e483

Please sign in to comment.