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>
This commit is contained in:
@@ -1237,6 +1237,17 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(hid_connect);
|
||||
|
||||
void hid_disconnect(struct hid_device *hdev)
|
||||
{
|
||||
if (hdev->claimed & HID_CLAIMED_INPUT)
|
||||
hidinput_disconnect(hdev);
|
||||
if (hdev->claimed & HID_CLAIMED_HIDDEV)
|
||||
hdev->hiddev_disconnect(hdev);
|
||||
if (hdev->claimed & HID_CLAIMED_HIDRAW)
|
||||
hidraw_disconnect(hdev);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(hid_disconnect);
|
||||
|
||||
/* a list of devices for which there is a specialized driver on HID bus */
|
||||
static const struct hid_device_id hid_blacklist[] = {
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },
|
||||
|
Reference in New Issue
Block a user