Sorry, next time I will compiled before sending the patch... The variable "ret" in the #ifdef'ed code was missing. Appended code now defines this variable. - -- Uwe Bonnes [email protected]
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ---------- >From f104d08e5c0d0e5c2322adc6d90ad379dd6442b0 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes <[email protected]> Date: Tue, 18 May 2010 12:34:24 +0200 Subject: In linusb-1.0, libusb_detach_kernel_driver is available unconditional --- src/ftdi.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/src/ftdi.c b/src/ftdi.c index 5c25abd..4cbf315 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -442,7 +442,7 @@ int ftdi_usb_open_dev(struct ftdi_context *ftdi, libusb_device *dev) { struct libusb_device_descriptor desc; struct libusb_config_descriptor *config0; - int cfg, cfg0; + int cfg, cfg0, ret; if (ftdi == NULL) ftdi_error_return(-8, "ftdi context invalid"); @@ -458,7 +458,6 @@ int ftdi_usb_open_dev(struct ftdi_context *ftdi, libusb_device *dev) cfg0 = config0->bConfigurationValue; libusb_free_config_descriptor (config0); -#ifdef LIBUSB_HAS_GET_DRIVER_NP // Try to detach ftdi_sio kernel module. // Returns ENODATA if driver is not loaded. // @@ -469,7 +468,6 @@ int ftdi_usb_open_dev(struct ftdi_context *ftdi, libusb_device *dev) ret = libusb_detach_kernel_driver(ftdi->usb_dev, ftdi->interface); if (ret < 0 && ret != LIBUSB_ERROR_NOT_FOUND) ftdi_error_return(-11, "libusb_detach_kernel_driver () failed"); -#endif if (libusb_get_configuration (ftdi->usb_dev, &cfg) < 0) ftdi_error_return(-12, "libusb_get_configuration () failed"); -- 1.6.4.2 -- libftdi - see http://www.intra2net.com/en/developer/libftdi for details. To unsubscribe send a mail to [email protected]
