diff options
author | Jiri Kosina <jkosina@suse.cz> | 2009-09-15 10:27:45 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2009-09-17 09:15:11 -0400 |
commit | c4c259bcc27c4242b012106afdba183622b1735f (patch) | |
tree | 5db41b8ea3d43f3a10479257da302590a6b974f2 /drivers/hid/hid-core.c | |
parent | d1ff65226c5afe55f9af38a439058f41b71e114f (diff) |
HID: consolidate connect and disconnect into core code
HID core registers input, hidraw and hiddev devices, but leaves
unregistering it up to the individual driver, which is not really nice.
Let's move all the logic to the core.
Reported-by: Marcel Holtmann <marcel@holtmann.org>
Reported-by: Brian Rogers <brian@xyzw.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-core.c')
-rw-r--r-- | drivers/hid/hid-core.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index ca9bb26c2076..be34d32906bd 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1237,6 +1237,17 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask) | |||
1237 | } | 1237 | } |
1238 | EXPORT_SYMBOL_GPL(hid_connect); | 1238 | EXPORT_SYMBOL_GPL(hid_connect); |
1239 | 1239 | ||
1240 | void hid_disconnect(struct hid_device *hdev) | ||
1241 | { | ||
1242 | if (hdev->claimed & HID_CLAIMED_INPUT) | ||
1243 | hidinput_disconnect(hdev); | ||
1244 | if (hdev->claimed & HID_CLAIMED_HIDDEV) | ||
1245 | hdev->hiddev_disconnect(hdev); | ||
1246 | if (hdev->claimed & HID_CLAIMED_HIDRAW) | ||
1247 | hidraw_disconnect(hdev); | ||
1248 | } | ||
1249 | EXPORT_SYMBOL_GPL(hid_disconnect); | ||
1250 | |||
1240 | /* a list of devices for which there is a specialized driver on HID bus */ | 1251 | /* a list of devices for which there is a specialized driver on HID bus */ |
1241 | static const struct hid_device_id hid_blacklist[] = { | 1252 | static const struct hid_device_id hid_blacklist[] = { |
1242 | { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) }, | 1253 | { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) }, |