mirror of https://gitee.com/openkylin/linux.git
HID: cp2112: convert to use hid_hw_raw_request()
Commit cafebc0
("HID: remove hid_get_raw_report in struct hid_device")
obsoletes the use of hdev->hid_get_raw_report(), as calling
hid_hw_raw_request() is functionally equivalent.
Convert cp2112 to use this notation.
Reported-by: fengguang.wu@intel.com
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
d6a611f5e3
commit
490051ad16
|
@ -174,8 +174,9 @@ static int cp2112_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
|
||||||
u8 buf[5];
|
u8 buf[5];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = hdev->hid_get_raw_report(hdev, CP2112_GPIO_CONFIG, buf,
|
ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf,
|
||||||
sizeof(buf), HID_FEATURE_REPORT);
|
sizeof(buf), HID_FEATURE_REPORT,
|
||||||
|
HID_REQ_GET_REPORT);
|
||||||
if (ret != sizeof(buf)) {
|
if (ret != sizeof(buf)) {
|
||||||
hid_err(hdev, "error requesting GPIO config: %d\n", ret);
|
hid_err(hdev, "error requesting GPIO config: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -220,8 +221,8 @@ static int cp2112_gpio_get(struct gpio_chip *chip, unsigned offset)
|
||||||
u8 buf[2];
|
u8 buf[2];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = hdev->hid_get_raw_report(hdev, CP2112_GPIO_GET, buf, sizeof(buf),
|
ret = hid_hw_raw_request(hdev, CP2112_GPIO_GET, buf, sizeof(buf),
|
||||||
HID_FEATURE_REPORT);
|
HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
|
||||||
if (ret != sizeof(buf)) {
|
if (ret != sizeof(buf)) {
|
||||||
hid_err(hdev, "error requesting GPIO values: %d\n", ret);
|
hid_err(hdev, "error requesting GPIO values: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -241,8 +242,9 @@ static int cp2112_gpio_direction_output(struct gpio_chip *chip,
|
||||||
|
|
||||||
cp2112_gpio_set(chip, offset, value);
|
cp2112_gpio_set(chip, offset, value);
|
||||||
|
|
||||||
ret = hdev->hid_get_raw_report(hdev, CP2112_GPIO_CONFIG, buf,
|
ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf,
|
||||||
sizeof(buf), HID_FEATURE_REPORT);
|
sizeof(buf), HID_FEATURE_REPORT,
|
||||||
|
HID_REQ_GET_REPORT);
|
||||||
if (ret != sizeof(buf)) {
|
if (ret != sizeof(buf)) {
|
||||||
hid_err(hdev, "error requesting GPIO config: %d\n", ret);
|
hid_err(hdev, "error requesting GPIO config: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -271,8 +273,8 @@ static int cp2112_hid_get(struct hid_device *hdev, unsigned char report_number,
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
ret = hdev->hid_get_raw_report(hdev, report_number, buf, count,
|
ret = hid_hw_raw_request(hdev, report_number, buf, count,
|
||||||
report_type);
|
report_type, HID_REQ_GET_REPORT);
|
||||||
memcpy(data, buf, count);
|
memcpy(data, buf, count);
|
||||||
kfree(buf);
|
kfree(buf);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue