Skip to content

Commit 293e483

Browse files
bentissJiri Kosina
authored andcommitted
HID: cp2112: remove various hid_out_raw_report calls
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>
1 parent c16527c commit 293e483

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎drivers/hid/hid-cp2112.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ static int cp2112_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
185185
buf[1] &= ~(1 << offset);
186186
buf[2] = gpio_push_pull;
187187

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

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

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

0 commit comments

Comments
 (0)