mirror of
https://git.proxmox.com/git/fwupd
synced 2025-11-01 01:11:54 +00:00
Use new GUsb functionality to fix flashing Unifying devices
This avoids open()ing and close()ing multiple times on hotplug -- which in itself isn't a huge problem as the requests are refcounted in libusb, but it matters hugely when a plugin accidentally closes a device that was not opened. As all the devices are going to be opened anyway (to read the vendor strings) and the cost of keeping the device is open is tiny, just get libgusb to auto-open *all* devices and keep them open for the duration. Fixes: https://github.com/hughsie/fwupd/issues/155
This commit is contained in:
parent
f592b06722
commit
1ad45caeec
@ -2419,6 +2419,10 @@ fu_engine_load (FuEngine *self, GError **error)
|
||||
g_prefix_error (error, "Failed to get USB context: ");
|
||||
return FALSE;
|
||||
}
|
||||
#if G_USB_CHECK_VERSION(0,2,11)
|
||||
g_usb_context_set_flags (self->usb_ctx,
|
||||
G_USB_CONTEXT_FLAGS_AUTO_OPEN_DEVICES);
|
||||
#endif
|
||||
|
||||
#if AS_CHECK_VERSION(0,6,13)
|
||||
/* load the hwids */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user