Set USB configuration only if different from the current one

This follows up on earlier USB3 fixes.  It only addresses libusb-1.0
because there is no convenience API for libusb-0.1 to get the current
configuration.
merge-requests/1/head
Olaf Meeuwissen 2014-12-02 11:59:35 +09:00 zatwierdzone przez m. allan noah
rodzic 5283a8792e
commit 365b619dfe
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -1673,8 +1673,10 @@ sanei_usb_open (SANE_String_Const devname, SANE_Int * dn)
desc.bNumConfigurations,
config0->bConfigurationValue);
result = libusb_set_configuration (devices[devcount].lu_handle,
config0->bConfigurationValue);
result = 0;
if (config != config0->bConfigurationValue)
result = libusb_set_configuration (devices[devcount].lu_handle,
config0->bConfigurationValue);
if (result < 0)
{