qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] usb-host: set ifs.detached as true if kernel dr


From: linzhecheng
Subject: Re: [Qemu-devel] [PATCH] usb-host: set ifs.detached as true if kernel driver is not active
Date: Tue, 20 Nov 2018 08:28:00 +0000


> -----Original Message-----
> From: Gerd Hoffmann [mailto:address@hidden
> Sent: Tuesday, November 20, 2018 4:25 PM
> To: linzhecheng <address@hidden>
> Cc: address@hidden; Zhoujian (jay) <address@hidden>;
> wangxin (U) <address@hidden>
> Subject: Re: [PATCH] usb-host: set ifs.detached as true if kernel driver is 
> not
> active
> 
> On Tue, Nov 20, 2018 at 09:18:15AM +0800, linzhecheng wrote:
> > If no kernel driver is active, we can already claim and perform I/O on
> > it without detaching it.
> >
> > Signed-off-by: linzhecheng <address@hidden>
> >
> > diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index
> > f31e9cbbb8..db4ae1e6e8 100644
> > --- a/hw/usb/host-libusb.c
> > +++ b/hw/usb/host-libusb.c
> > @@ -1119,6 +1119,10 @@ static void
> usb_host_detach_kernel(USBHostDevice *s)
> >      for (i = 0; i < USB_MAX_INTERFACES; i++) {
> >          rc = libusb_kernel_driver_active(s->dh, i);
> >          usb_host_libusb_error("libusb_kernel_driver_active", rc);
> > +        if (rc == 0) {
> > +            s->ifs[i].detached = true;
> > +            continue;
> > +        }
> >          if (rc != 1) {
> 
> Can't we just add detached = true here?
Yes, it's better.
> 
> >              continue;
> >          }
> 
> cheers,
>   Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]