diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2021-05-16 00:48:49 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2021-08-30 13:51:46 +0000 |
commit | b3a51bbb590cca6d6536532d8c0965748410f277 (patch) | |
tree | 65e96c27c3fcc2ac29c473113f0ed02f649e6529 /src/helper | |
parent | c281c64469de3c92b2fad0933722cb95b710b02a (diff) | |
download | riscv-openocd-b3a51bbb590cca6d6536532d8c0965748410f277.zip riscv-openocd-b3a51bbb590cca6d6536532d8c0965748410f277.tar.gz riscv-openocd-b3a51bbb590cca6d6536532d8c0965748410f277.tar.bz2 |
helper: remove fix for libusb pre-v1.0.9
Libusb v1.0.9 has been released on April 2012. We can reasonably
expect that every user has already updated his system to a libusb
newer of equel to v1.0.9.
Remove the fix for older libusb.
Change-Id: I0c40e53d7af85a11b0bb265bbf8035857a2dfce1
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6253
Tested-by: jenkins
Reviewed-by: Xiaofan Chen <xiaofanc@gmail.com>
Diffstat (limited to 'src/helper')
-rw-r--r-- | src/helper/Makefile.am | 2 | ||||
-rw-r--r-- | src/helper/replacements.c | 42 | ||||
-rw-r--r-- | src/helper/replacements.h | 4 |
3 files changed, 0 insertions, 48 deletions
diff --git a/src/helper/Makefile.am b/src/helper/Makefile.am index 42cee80..0d88684 100644 --- a/src/helper/Makefile.am +++ b/src/helper/Makefile.am @@ -1,7 +1,5 @@ noinst_LTLIBRARIES += %D%/libhelper.la -%C%_libhelper_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB1_CFLAGS) - %C%_libhelper_la_SOURCES = \ %D%/binarybuffer.c \ %D%/options.c \ diff --git a/src/helper/replacements.c b/src/helper/replacements.c index 81b1976..c34b17e 100644 --- a/src/helper/replacements.c +++ b/src/helper/replacements.c @@ -275,45 +275,3 @@ int win_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct time return retcode; } #endif - -#if defined HAVE_LIBUSB1 && !defined HAVE_LIBUSB_ERROR_NAME -#include <libusb.h> -/* Verbatim from git://git.libusb.org/libusb.git tag 1.0.9 - * The libusb_error enum is compatible down to v0.9.1 - */ -const char *libusb_error_name(int error_code) -{ - enum libusb_error error = error_code; - switch (error) { - case LIBUSB_SUCCESS: - return "LIBUSB_SUCCESS"; - case LIBUSB_ERROR_IO: - return "LIBUSB_ERROR_IO"; - case LIBUSB_ERROR_INVALID_PARAM: - return "LIBUSB_ERROR_INVALID_PARAM"; - case LIBUSB_ERROR_ACCESS: - return "LIBUSB_ERROR_ACCESS"; - case LIBUSB_ERROR_NO_DEVICE: - return "LIBUSB_ERROR_NO_DEVICE"; - case LIBUSB_ERROR_NOT_FOUND: - return "LIBUSB_ERROR_NOT_FOUND"; - case LIBUSB_ERROR_BUSY: - return "LIBUSB_ERROR_BUSY"; - case LIBUSB_ERROR_TIMEOUT: - return "LIBUSB_ERROR_TIMEOUT"; - case LIBUSB_ERROR_OVERFLOW: - return "LIBUSB_ERROR_OVERFLOW"; - case LIBUSB_ERROR_PIPE: - return "LIBUSB_ERROR_PIPE"; - case LIBUSB_ERROR_INTERRUPTED: - return "LIBUSB_ERROR_INTERRUPTED"; - case LIBUSB_ERROR_NO_MEM: - return "LIBUSB_ERROR_NO_MEM"; - case LIBUSB_ERROR_NOT_SUPPORTED: - return "LIBUSB_ERROR_NOT_SUPPORTED"; - case LIBUSB_ERROR_OTHER: - return "LIBUSB_ERROR_OTHER"; - } - return "**UNKNOWN**"; -} -#endif diff --git a/src/helper/replacements.h b/src/helper/replacements.h index 5aecf41..4d70d9c 100644 --- a/src/helper/replacements.h +++ b/src/helper/replacements.h @@ -328,8 +328,4 @@ typedef struct { #endif /* HAVE_ELF64 */ -#if defined HAVE_LIBUSB1 && !defined HAVE_LIBUSB_ERROR_NAME -const char *libusb_error_name(int error_code); -#endif /* defined HAVE_LIBUSB1 && !defined HAVE_LIBUSB_ERROR_NAME */ - #endif /* OPENOCD_HELPER_REPLACEMENTS_H */ |