Add and use libusb_set_auto_detach_kernel_driver for the Switch 2 driver

This commit is contained in:
Vicki Pfau
2026-02-04 22:38:32 -08:00
committed by Sam Lantinga
parent b9743eabdd
commit e1b8ad0380
3 changed files with 3 additions and 0 deletions

View File

@@ -381,6 +381,7 @@ static bool HIDAPI_DriverSwitch2_InitUSB(SDL_HIDAPI_Device *device)
return SDL_SetError("Couldn't find bulk endpoints");
}
ctx->libusb->set_auto_detach_kernel_driver(ctx->device_handle, true);
int res = ctx->libusb->claim_interface(ctx->device_handle, ctx->interface_number);
if (res < 0) {
return SDL_SetError("Couldn't claim interface %d: %d\n", ctx->interface_number, res);