]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
HID: core: do not scan reports if the group is already set
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Tue, 30 Sep 2014 17:18:24 +0000 (13:18 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 30 Apr 2016 22:05:48 +0000 (00:05 +0200)
commit 9578f41aeaee5010384f4f8484da1566e2ce4901 upstream.

This allows the transport layer (I have in mind hid-logitech-dj and uhid)
to set the group before it is added to the hid bus. This way, it can
bypass the hid_scan_report() call, and choose in advance which driver
will handle the newly created hid device.

Signed-off-by: Benjamin Tisssoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/hid/hid-core.c

index 8e3c270dd0c29d73043c513d7dbc5fec2d34f1b3..d47fbc7774cf45b22eea7bd1005fef16b47f9152 100644 (file)
@@ -2532,7 +2532,8 @@ int hid_add_device(struct hid_device *hdev)
         * Scan generic devices for group information
         */
        if (hid_ignore_special_drivers ||
-           !hid_match_id(hdev, hid_have_special_driver)) {
+           (!hdev->group &&
+            !hid_match_id(hdev, hid_have_special_driver))) {
                ret = hid_scan_report(hdev);
                if (ret)
                        hid_warn(hdev, "bad device descriptor (%d)\n", ret);