mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 23:29:44 -06:00
GC Adapter: don’t stop scanning after failing to claim an adapter
Only call Shutdown() after all devices have been tested.
This commit is contained in:
@ -143,14 +143,12 @@ void Setup()
|
|||||||
if (ret == LIBUSB_ERROR_NOT_SUPPORTED)
|
if (ret == LIBUSB_ERROR_NOT_SUPPORTED)
|
||||||
s_libusb_driver_not_supported = true;
|
s_libusb_driver_not_supported = true;
|
||||||
}
|
}
|
||||||
Shutdown();
|
|
||||||
}
|
}
|
||||||
else if ((ret = libusb_kernel_driver_active(s_handle, 0)) == 1)
|
else if ((ret = libusb_kernel_driver_active(s_handle, 0)) == 1)
|
||||||
{
|
{
|
||||||
if ((ret = libusb_detach_kernel_driver(s_handle, 0)) && ret != LIBUSB_ERROR_NOT_SUPPORTED)
|
if ((ret = libusb_detach_kernel_driver(s_handle, 0)) && ret != LIBUSB_ERROR_NOT_SUPPORTED)
|
||||||
{
|
{
|
||||||
ERROR_LOG(SERIALINTERFACE, "libusb_detach_kernel_driver failed with error: %d", ret);
|
ERROR_LOG(SERIALINTERFACE, "libusb_detach_kernel_driver failed with error: %d", ret);
|
||||||
Shutdown();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -161,12 +159,10 @@ void Setup()
|
|||||||
else if ((ret != 0 && ret != LIBUSB_ERROR_NOT_SUPPORTED))
|
else if ((ret != 0 && ret != LIBUSB_ERROR_NOT_SUPPORTED))
|
||||||
{
|
{
|
||||||
ERROR_LOG(SERIALINTERFACE, "libusb_kernel_driver_active error ret = %d", ret);
|
ERROR_LOG(SERIALINTERFACE, "libusb_kernel_driver_active error ret = %d", ret);
|
||||||
Shutdown();
|
|
||||||
}
|
}
|
||||||
else if ((ret = libusb_claim_interface(s_handle, 0)))
|
else if ((ret = libusb_claim_interface(s_handle, 0)))
|
||||||
{
|
{
|
||||||
ERROR_LOG(SERIALINTERFACE, "libusb_claim_interface failed with error: %d", ret);
|
ERROR_LOG(SERIALINTERFACE, "libusb_claim_interface failed with error: %d", ret);
|
||||||
Shutdown();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -175,6 +171,8 @@ void Setup()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!s_detected)
|
||||||
|
Shutdown();
|
||||||
|
|
||||||
libusb_free_device_list(list, 1);
|
libusb_free_device_list(list, 1);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user