HID: remove hid_get_raw_report in struct hid_device
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Wed, 5 Feb 2014 21:33:22 +0000 (16:33 -0500)
committerJiri Kosina <jkosina@suse.cz>
Mon, 17 Feb 2014 13:05:58 +0000 (14:05 +0100)
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: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-input.c
drivers/hid/hid-sony.c
drivers/hid/hidraw.c
drivers/hid/i2c-hid/i2c-hid.c
drivers/hid/uhid.c
drivers/hid/usbhid/hid-core.c
include/linux/hid.h
net/bluetooth/hidp/core.c

index e5bb3c3782929c6a32668b5c129730d078d534b1..5bd17b2568562aa56007ad01c224105981ee212b 100644 (file)
@@ -350,9 +350,9 @@ static int hidinput_get_battery_property(struct power_supply *psy,
                        ret = -ENOMEM;
                        break;
                }
-               ret = dev->hid_get_raw_report(dev, dev->battery_report_id,
-                                             buf, 2,
-                                             dev->battery_report_type);
+               ret = hid_hw_raw_request(dev, dev->battery_report_id, buf, 2,
+                                        dev->battery_report_type,
+                                        HID_REQ_GET_REPORT);
 
                if (ret != 2) {
                        ret = -ENODATA;
index 12354055d4745a4a50e783f624ec8b24bee46dc4..3930acbdee987ee2810c64f68ca72036e8b46617 100644 (file)
@@ -706,7 +706,8 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev)
        if (!buf)
                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)
                hid_err(hdev, "can't set operational mode\n");
index cb0137b3718d8cd0a42d6483a9817a26733452c6..4b2dc956c702dcbb27f8fa47264d1a20a39255c4 100644 (file)
@@ -189,7 +189,7 @@ static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t
 
        dev = hidraw_table[minor]->hid;
 
-       if (!dev->hid_get_raw_report) {
+       if (!dev->ll_driver->raw_request) {
                ret = -ENODEV;
                goto out;
        }
@@ -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,
-        * 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)) {
                ret = -EFAULT;
                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)
                goto out_free;
index e914f27554913ab08c903be673a5c641731058b6..f4ea7343e823a587abfaf81c49b2b789bf711e8e 100644 (file)
@@ -1005,7 +1005,6 @@ static int i2c_hid_probe(struct i2c_client *client,
 
        hid->driver_data = client;
        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->dev.parent = &client->dev;
        ACPI_COMPANION_SET(&hid->dev, ACPI_COMPANION(&client->dev));
index f5a2b193114392cf7c3b8fc716d2650654708f66..12439e1eeae2e8e3ea86379852da1caba006d219 100644 (file)
@@ -404,7 +404,6 @@ static int uhid_dev_create(struct uhid_device *uhid,
        hid->uniq[63] = 0;
 
        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->bus = ev->u.create.bus;
        hid->vendor = ev->u.create.vendor;
index 406497b120ea99b808d55ea277f6dc6d3326c039..b9a770f4d7aef9812e74379a7c8ba5513d8da8d4 100644 (file)
@@ -1289,7 +1289,6 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *
 
        usb_set_intfdata(intf, hid);
        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->ff_init = hid_pidff_init;
 #ifdef CONFIG_USB_HIDDEV
index 38c307b8138a411732800ef56bc3ba319fb09273..c56681a66b0b04689f9ae32d0423b31943484d83 100644 (file)
@@ -508,9 +508,6 @@ struct hid_device {                                                 /* device report descriptor */
                                  struct hid_usage *, __s32);
        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 */
        int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t, unsigned char);
 
index 02670b30895aec6e72d69d48ff6b0d60136144c0..77c4badb3e9d7bbc93a1d1ff35fce210ce23a200 100644 (file)
@@ -773,7 +773,6 @@ static int hidp_setup_hid(struct hidp_session *session,
        hid->dev.parent = &session->conn->hcon->dev;
        hid->ll_driver = &hidp_hid_driver;
 
-       hid->hid_get_raw_report = hidp_get_raw_report;
        hid->hid_output_raw_report = hidp_output_raw_report;
 
        /* True if device is blacklisted in drivers/hid/hid-core.c */