Skip to contentSkip to conversation

usb-host: set ifs.detached as true if kernel driver is not active

PATCH In review linzhecheng 2 participants 2 messages Nov 20, 2018 – Nov 26, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 usb-host: set ifs.detached as true if kernel driver is not active

If no kernel driver is active, we can already claim and perform I/O on it without detaching it.

hw/usb/host-libusb.c +3 -0
index f31e9cbbb8..b6602ded4e 100644
@@ -1120,6 +1120,9 @@ static void usb_host_detach_kernel(USBHostDevice *s)
         rc = libusb_kernel_driver_active(s->dh, i);
         usb_host_libusb_error("libusb_kernel_driver_active", rc);
         if (rc != 1) {
+            if (rc == 0) {
+                s->ifs[i].detached = true;
+            }
             continue;
         }
         trace_usb_host_detach_kernel(s->bus_num, s->addr, i);
Signature · 1 line
2.12.2.windows.2
#1 lore raw
Quoted 2 lines · linzhecheng

If no kernel driver is active, we can already claim and perform I/O on it without detaching it.

Queued for 3.1

thanks,
Gerd