fix build failure in libusb_context change
authorMike Frysinger <vapier@gentoo.org>
Tue, 22 Jun 2010 23:42:11 +0000 (19:42 -0400)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 23 Jun 2010 07:16:32 +0000 (09:16 +0200)
Current git tree build fails:
ftdi.c: In function 'ftdi_transfer_data_done':
ftdi.c:1513:36: error: 'ftdi' undeclared (first use in this function)

This function has a ftdi_transfer_control tc, not a ftdi_context ftdi.

Probably want to squash this into commit:
02212d8e84cccd393a95612d4c4a5ec495fa3e2e
Store and use the libusb_context

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

src/ftdi.c

index 167810b..9b20c37 100644 (file)
@@ -1510,14 +1510,14 @@ int ftdi_transfer_data_done(struct ftdi_transfer_control *tc)
 
     while (!tc->completed)
     {
-        ret = libusb_handle_events(ftdi->usb_ctx);
+        ret = libusb_handle_events(tc->ftdi->usb_ctx);
         if (ret < 0)
         {
             if (ret == LIBUSB_ERROR_INTERRUPTED)
                 continue;
             libusb_cancel_transfer(tc->transfer);
             while (!tc->completed)
-                if (libusb_handle_events(ftdi->usb_ctx) < 0)
+                if (libusb_handle_events(tc->ftdi->usb_ctx) < 0)
                     break;
             libusb_free_transfer(tc->transfer);
             free (tc);