Skip to content

Commit 9578f41

Browse files
bentissJiri Kosina
authored andcommitted
HID: core: do not scan reports if the group is already set
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 <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent c241c5e commit 9578f41

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/hid/hid-core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2535,7 +2535,8 @@ int hid_add_device(struct hid_device *hdev)
25352535
* Scan generic devices for group information
25362536
*/
25372537
if (hid_ignore_special_drivers ||
2538-
!hid_match_id(hdev, hid_have_special_driver)) {
2538+
(!hdev->group &&
2539+
!hid_match_id(hdev, hid_have_special_driver))) {
25392540
ret = hid_scan_report(hdev);
25402541
if (ret)
25412542
hid_warn(hdev, "bad device descriptor (%d)\n", ret);

0 commit comments

Comments
 (0)