Skip to content

Commit

Permalink
ch341a_spi: Avoid deprecated libusb functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
al3xtjames authored and i-c-o-n committed May 11, 2018
1 parent 2099c64 commit 291764a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ch341a_spi.c
Expand Up @@ -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;
Expand Down

0 comments on commit 291764a

Please sign in to comment.