libftdi Archives

Subject: Re: Time for 0.18?

From: Xiaofan Chen <xiaofanc@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 8 Jun 2010 20:11:34 +0800
On Mon, Jun 7, 2010 at 11:30 PM, Thomas Jarosch
<thomas.jarosch@xxxxxxxxxxxxx> wrote:
> Can you check if the problem you are seeing is fixed with libftdi git?
>

How about this minor fix to remove unreachable codes for Win32.

http://developer.intra2net.com/mailarchive/html/libftdi/2010/msg00177.html

For Windows libusb-win32, LIBUSB_HAS_GET_DRIVER_NP
is not defined. So detach_errno will stay at zero. This patch
remove the unreachable codes for Win32.

diff --git a/src/ftdi.c b/src/ftdi.c
index ac56d08..aedf009 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -491,14 +491,7 @@ int ftdi_usb_open_dev(struct ftdi_context *ftdi,
struct usb_device *dev)
             errno != EBUSY)
         {
             ftdi_usb_close_internal (ftdi);
-            if (detach_errno == EPERM)
-            {
-                ftdi_error_return(-8, "inappropriate permissions on device!");
-            }
-            else
-            {
-                ftdi_error_return(-3, "unable to set usb
configuration. Make sure ftdi_sio is unloaded!");
-            }
+            ftdi_error_return(-3, "unable to set configuration. Make
sure libusb-win32 is properly installed!");
         }
     }
 #endif


-- 
Xiaofan http://mcuee.blogspot.com

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread