ftdi: don't wait forever if we fail
commitdb6c6f5da4deaffc548122703e6951d0b1710603
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>
Sun, 14 Aug 2016 13:15:27 +0000 (14 15:15 +0200)
committerSpencer Oliver <spen@spen-soft.co.uk>
Tue, 4 Oct 2016 10:51:31 +0000 (4 11:51 +0100)
tree2462093d33964a6a17127324b3abee21f49a95fe
parent5fd5699859db4be2dadef69c85adbb0acda36e84
ftdi: don't wait forever if we fail

Currently if ftdi device is removed, OpenOCD will stall forever.
Only kill -9 will help in this case.
This patch makes use of libusb timeout functions and
trying to break out of while loop if some error is detected.

[andreas.fritiofson@gmail.com]: Add missing retval check

Change-Id: I97506190e376026705f14ef9fe37dc811b99b3ac
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3419
Reviewed-by: Andreas Färber <afaerber@suse.de>
Tested-by: jenkins
src/jtag/drivers/mpsse.c