summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2012-04-23 10:07:04 (GMT)
committerJiri Kosina <jkosina@suse.cz>2012-05-01 10:54:54 (GMT)
commit7431fb767d896b7f0048039f2e17707ea057d35a (patch)
tree447b273a486a8855a0d88e905b0dde1b1c38feae /drivers/hid
parent734c660931095ae165c0db6ff60558fc4173bfd0 (diff)
downloadlinux-7431fb767d896b7f0048039f2e17707ea057d35a.tar.xz
HID: Allow bus wildcard matching
Most HID drivers do not need to know what bus driver is in use. A generic group driver can drive any hid device, and the device list should not need to be duplicated for each new bus. This patch adds wildcard matching to the HID bus, simplifying device list handling for group drivers. Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index f932cd5..20daee5 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1273,7 +1273,7 @@ EXPORT_SYMBOL_GPL(hid_input_report);
static bool hid_match_one_id(struct hid_device *hdev,
const struct hid_device_id *id)
{
- return id->bus == hdev->bus &&
+ return (id->bus == HID_BUS_ANY || id->bus == hdev->bus) &&
(id->group == HID_GROUP_ANY || id->group == hdev->group) &&
(id->vendor == HID_ANY_ID || id->vendor == hdev->vendor) &&
(id->product == HID_ANY_ID || id->product == hdev->product);