Re-attach usb device to kernel while usb_host_open fails
Signed-off-by: Lin Ma <lma@suse.com> Reviewed-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
2d5ee9e7a7
commit
6110ce59af
|
@ -889,6 +889,9 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev)
|
||||||
fail:
|
fail:
|
||||||
trace_usb_host_open_failure(bus_num, addr);
|
trace_usb_host_open_failure(bus_num, addr);
|
||||||
if (s->dh != NULL) {
|
if (s->dh != NULL) {
|
||||||
|
usb_host_release_interfaces(s);
|
||||||
|
libusb_reset_device(s->dh);
|
||||||
|
usb_host_attach_kernel(s);
|
||||||
libusb_close(s->dh);
|
libusb_close(s->dh);
|
||||||
s->dh = NULL;
|
s->dh = NULL;
|
||||||
s->dev = NULL;
|
s->dev = NULL;
|
||||||
|
|
Loading…
Reference in a new issue