linux: get_configuration don't return LIBUSB_ERROR_NOT_SUPPORTED with usbfs
authorHans de Goede <hdegoede@redhat.com>
Wed, 22 May 2013 18:45:26 +0000 (20:45 +0200)
committerHans de Goede <hdegoede@redhat.com>
Fri, 24 May 2013 11:58:37 +0000 (13:58 +0200)
We have an implementation of get_configuration with usbfs, so lets use it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
libusb/os/linux_usbfs.c
libusb/version_nano.h

index c0cdaaf..589ecac 100644 (file)
@@ -1219,10 +1219,13 @@ static int op_get_configuration(struct libusb_device_handle *handle,
        int *config)
 {
        int r;
-       if (sysfs_can_relate_devices != 1)
-               return LIBUSB_ERROR_NOT_SUPPORTED;
 
-       r = sysfs_get_active_config(handle->dev, config);
+       if (sysfs_can_relate_devices) {
+               r = sysfs_get_active_config(handle->dev, config);
+       } else {
+               r = usbfs_get_active_config(handle->dev,
+                                           _device_handle_priv(handle)->fd);
+       }
        if (r < 0)
                return r;
 
index 92e63f1..8054866 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 10707
+#define LIBUSB_NANO 10708