input/device: Don't destroy UHID device on disconnect

This makes classic HID behave like HoG which keeps the UHID device
around while disconnected so it doesn't have to be recreated on every
reconnection.
This commit is contained in:
Luiz Augusto von Dentz 2024-02-09 13:50:00 -05:00
parent 9698870015
commit ee880bee85

View File

@ -985,6 +985,10 @@ static int uhid_disconnect(struct input_device *idev)
if (!idev->uhid_created)
return 0;
/* Only destroy the node if virtual cable unplug flag has been set */
if (!idev->virtual_cable_unplug)
return 0;
bt_uhid_unregister_all(idev->uhid);
memset(&ev, 0, sizeof(ev));