From b241dd329cdad2779158e417e086b6a9bb9d6a2d Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 22 May 2013 20:45:26 +0200 Subject: [PATCH] linux: get_configuration don't return LIBUSB_ERROR_NOT_SUPPORTED with usbfs We have an implementation of get_configuration with usbfs, so lets use it. Signed-off-by: Hans de Goede --- libusb/os/linux_usbfs.c | 9 ++++++--- libusb/version_nano.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c index c0cdaaf..589ecac 100644 --- a/libusb/os/linux_usbfs.c +++ b/libusb/os/linux_usbfs.c @@ -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; diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 92e63f1..8054866 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10707 +#define LIBUSB_NANO 10708 -- 2.7.4