Skip to content

Commit 4392bf3

Browse files
bentissJiri Kosina
authored andcommitted
HID: fix hid_ignore_special_drivers module parameter
hid_ignore_special_drivers works fine until hid_scan_report autodetects and reassign devices (for hid-multitouch, hid-microsoft and hid-rmi). Simplify the handling of the parameter: if it is there, use hid-generic, no matter what, and if not, scan the device or rely on the hid_have_special_driver table. This was detected while trying to disable hid-multitouch on a Surface Pro cover which prevented to use the keyboard. Signed-off-by: Benjamin Tissoires <[email protected]> CC: [email protected] Signed-off-by: Jiri Kosina <[email protected]>
1 parent 5d74325 commit 4392bf3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/hid/hid-core.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,9 +2661,10 @@ int hid_add_device(struct hid_device *hdev)
26612661
/*
26622662
* Scan generic devices for group information
26632663
*/
2664-
if (hid_ignore_special_drivers ||
2665-
(!hdev->group &&
2666-
!hid_match_id(hdev, hid_have_special_driver))) {
2664+
if (hid_ignore_special_drivers) {
2665+
hdev->group = HID_GROUP_GENERIC;
2666+
} else if (!hdev->group &&
2667+
!hid_match_id(hdev, hid_have_special_driver)) {
26672668
ret = hid_scan_report(hdev);
26682669
if (ret)
26692670
hid_warn(hdev, "bad device descriptor (%d)\n", ret);

0 commit comments

Comments
 (0)