Commit cafebc05 authored by Benjamin Tissoires's avatar Benjamin Tissoires Committed by Jiri Kosina

HID: remove hid_get_raw_report in struct hid_device

dev->hid_get_raw_report(X) and hid_hw_raw_request(X, HID_REQ_GET_REPORT)
are strictly equivalent. Switch the hid subsystem to the hid_hw notation
and remove the field .hid_get_raw_report in struct hid_device.
Reviewed-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent f9bcca40
...@@ -350,9 +350,9 @@ static int hidinput_get_battery_property(struct power_supply *psy, ...@@ -350,9 +350,9 @@ static int hidinput_get_battery_property(struct power_supply *psy,
ret = -ENOMEM; ret = -ENOMEM;
break; break;
} }
ret = dev->hid_get_raw_report(dev, dev->battery_report_id, ret = hid_hw_raw_request(dev, dev->battery_report_id, buf, 2,
buf, 2, dev->battery_report_type,
dev->battery_report_type); HID_REQ_GET_REPORT);
if (ret != 2) { if (ret != 2) {
ret = -ENODATA; ret = -ENODATA;
......
...@@ -706,7 +706,8 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev) ...@@ -706,7 +706,8 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev)
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
ret = hdev->hid_get_raw_report(hdev, 0xf2, buf, 17, HID_FEATURE_REPORT); ret = hid_hw_raw_request(hdev, 0xf2, buf, 17, HID_FEATURE_REPORT,
HID_REQ_GET_REPORT);
if (ret < 0) if (ret < 0)
hid_err(hdev, "can't set operational mode\n"); hid_err(hdev, "can't set operational mode\n");
......
...@@ -189,7 +189,7 @@ static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t ...@@ -189,7 +189,7 @@ static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t
dev = hidraw_table[minor]->hid; dev = hidraw_table[minor]->hid;
if (!dev->hid_get_raw_report) { if (!dev->ll_driver->raw_request) {
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
} }
...@@ -216,14 +216,15 @@ static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t ...@@ -216,14 +216,15 @@ static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t
/* /*
* Read the first byte from the user. This is the report number, * Read the first byte from the user. This is the report number,
* which is passed to dev->hid_get_raw_report(). * which is passed to hid_hw_raw_request().
*/ */
if (copy_from_user(&report_number, buffer, 1)) { if (copy_from_user(&report_number, buffer, 1)) {
ret = -EFAULT; ret = -EFAULT;
goto out_free; goto out_free;
} }
ret = dev->hid_get_raw_report(dev, report_number, buf, count, report_type); ret = hid_hw_raw_request(dev, report_number, buf, count, report_type,
HID_REQ_GET_REPORT);
if (ret < 0) if (ret < 0)
goto out_free; goto out_free;
......
...@@ -1005,7 +1005,6 @@ static int i2c_hid_probe(struct i2c_client *client, ...@@ -1005,7 +1005,6 @@ static int i2c_hid_probe(struct i2c_client *client,
hid->driver_data = client; hid->driver_data = client;
hid->ll_driver = &i2c_hid_ll_driver; hid->ll_driver = &i2c_hid_ll_driver;
hid->hid_get_raw_report = i2c_hid_get_raw_report;
hid->hid_output_raw_report = i2c_hid_output_raw_report; hid->hid_output_raw_report = i2c_hid_output_raw_report;
hid->dev.parent = &client->dev; hid->dev.parent = &client->dev;
ACPI_COMPANION_SET(&hid->dev, ACPI_COMPANION(&client->dev)); ACPI_COMPANION_SET(&hid->dev, ACPI_COMPANION(&client->dev));
......
...@@ -404,7 +404,6 @@ static int uhid_dev_create(struct uhid_device *uhid, ...@@ -404,7 +404,6 @@ static int uhid_dev_create(struct uhid_device *uhid,
hid->uniq[63] = 0; hid->uniq[63] = 0;
hid->ll_driver = &uhid_hid_driver; hid->ll_driver = &uhid_hid_driver;
hid->hid_get_raw_report = uhid_hid_get_raw;
hid->hid_output_raw_report = uhid_hid_output_raw; hid->hid_output_raw_report = uhid_hid_output_raw;
hid->bus = ev->u.create.bus; hid->bus = ev->u.create.bus;
hid->vendor = ev->u.create.vendor; hid->vendor = ev->u.create.vendor;
......
...@@ -1289,7 +1289,6 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * ...@@ -1289,7 +1289,6 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *
usb_set_intfdata(intf, hid); usb_set_intfdata(intf, hid);
hid->ll_driver = &usb_hid_driver; hid->ll_driver = &usb_hid_driver;
hid->hid_get_raw_report = usbhid_get_raw_report;
hid->hid_output_raw_report = usbhid_output_raw_report; hid->hid_output_raw_report = usbhid_output_raw_report;
hid->ff_init = hid_pidff_init; hid->ff_init = hid_pidff_init;
#ifdef CONFIG_USB_HIDDEV #ifdef CONFIG_USB_HIDDEV
......
...@@ -508,9 +508,6 @@ struct hid_device { /* device report descriptor */ ...@@ -508,9 +508,6 @@ struct hid_device { /* device report descriptor */
struct hid_usage *, __s32); struct hid_usage *, __s32);
void (*hiddev_report_event) (struct hid_device *, struct hid_report *); void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
/* handler for raw input (Get_Report) data, used by hidraw */
int (*hid_get_raw_report) (struct hid_device *, unsigned char, __u8 *, size_t, unsigned char);
/* handler for raw output data, used by hidraw */ /* handler for raw output data, used by hidraw */
int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t, unsigned char); int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t, unsigned char);
......
...@@ -773,7 +773,6 @@ static int hidp_setup_hid(struct hidp_session *session, ...@@ -773,7 +773,6 @@ static int hidp_setup_hid(struct hidp_session *session,
hid->dev.parent = &session->conn->hcon->dev; hid->dev.parent = &session->conn->hcon->dev;
hid->ll_driver = &hidp_hid_driver; hid->ll_driver = &hidp_hid_driver;
hid->hid_get_raw_report = hidp_get_raw_report;
hid->hid_output_raw_report = hidp_output_raw_report; hid->hid_output_raw_report = hidp_output_raw_report;
/* True if device is blacklisted in drivers/hid/hid-core.c */ /* True if device is blacklisted in drivers/hid/hid-core.c */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment