summaryrefslogtreecommitdiffstats
path: root/ch341a_spi.c
diff options
context:
space:
mode:
authorAlex James <theracermaster@gmail.com>2018-04-14 22:59:57 -0500
committerNico Huber <nico.h@gmx.de>2018-05-11 16:32:42 +0000
commit291764a70e6d8b212680e311bfb0825abf2b9a2f (patch)
tree8c6d1c5156ba4e73169d4b541704a4f7c6326566 /ch341a_spi.c
parent2099c648b929cd36c500202089ef4b7a8c14680f (diff)
downloadflashrom-291764a70e6d8b212680e311bfb0825abf2b9a2f.tar.gz
flashrom-291764a70e6d8b212680e311bfb0825abf2b9a2f.tar.bz2
flashrom-291764a70e6d8b212680e311bfb0825abf2b9a2f.zip
ch341a_spi: Avoid deprecated libusb functions
libusb 1.0.22 marked libusb_set_debug as deprecated. For such versions of libusb, use libusb_set_option instead. Change-Id: Ib71ebe812316eaf49136979a942a946ef9e4d487 Signed-off-by: Alex James <theracermaster@gmail.com> Reviewed-on: https://review.coreboot.org/25681 Tested-by: Nico Huber <nico.h@gmx.de> Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Diffstat (limited to 'ch341a_spi.c')
-rw-r--r--ch341a_spi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ch341a_spi.c b/ch341a_spi.c
index 95e9c9577..ee18624ea 100644
--- a/ch341a_spi.c
+++ b/ch341a_spi.c
@@ -441,7 +441,12 @@ int ch341a_spi_init(void)
return -1;
}
- libusb_set_debug(NULL, 3); // Enable information, warning and error messages (only).
+ /* Enable information, warning, and error messages (only). */
+#if LIBUSB_API_VERSION < 0x01000106
+ libusb_set_debug(NULL, 3);
+#else
+ libusb_set_option(NULL, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_INFO);
+#endif
uint16_t vid = devs_ch341a_spi[0].vendor_id;
uint16_t pid = devs_ch341a_spi[0].device_id;