]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/hid/hid-core.c
Merge branch 'for-3.15/hid-cp2112' into for-3.15/hid-core-ll-transport-cleanup
[mirror_ubuntu-artful-kernel.git] / drivers / hid / hid-core.c
index 2011136cb35f9103aae28bc78c8398883db36043..ddb981db08bdd14dc4e6f1db34a8ed77bb0de95f 100644 (file)
@@ -1330,9 +1330,6 @@ void __hid_request(struct hid_device *hid, struct hid_report *report,
        int ret;
        int len;
 
-       if (!hid->ll_driver->raw_request)
-               return;
-
        buf = hid_alloc_report_buf(report, GFP_KERNEL);
        if (!buf)
                return;
@@ -2472,6 +2469,14 @@ int hid_add_device(struct hid_device *hdev)
        if (hid_ignore(hdev))
                return -ENODEV;
 
+       /*
+        * Check for the mandatory transport channel.
+        */
+        if (!hdev->ll_driver->raw_request) {
+               hid_err(hdev, "transport driver missing .raw_request()\n");
+               return -EINVAL;
+        }
+
        /*
         * Read the device report descriptor once and use as template
         * for the driver-specific modifications.