X-Git-Url: https://git.ao2.it/libam7xxx.git/blobdiff_plain/c71788d6309eafd1d0bdc503ebb75055c43c0416..2f9553ff3efdbd00111e90774fd90907a2e45200:/src/am7xxx.c diff --git a/src/am7xxx.c b/src/am7xxx.c index 89eaab4..6595ccf 100644 --- a/src/am7xxx.c +++ b/src/am7xxx.c @@ -34,7 +34,7 @@ * taken from: http://unixwiz.net/techtips/gnu-c-attributes.html) */ #ifndef __GNUC__ -# define __attribute__(x) /*NOTHING*/ +# define __attribute__(x) /* NOTHING */ #endif /* Control shared library symbols visibility */ @@ -736,6 +736,15 @@ static int open_device(am7xxx_context *ctx, current_configuration = -1; libusb_get_configuration((*dev)->usb_device, ¤t_configuration); if (current_configuration != (*dev)->desc->configuration) { + /* + * In principle kernel drivers bound to each interface should + * be detached before setting the configuration, but in + * practice this is not necessary for most devices. + * + * For example something like the following function would be + * called: + * libusb_detach_all_kernel_drivers((*dev)->usb_device); + */ ret = libusb_set_configuration((*dev)->usb_device, (*dev)->desc->configuration); if (ret < 0) {