Nico Huber merged this change.

View Change

Approvals: Nico Huber: Verified David Hendricks: Looks good to me, approved
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>
---
M ch341a_spi.c
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ch341a_spi.c b/ch341a_spi.c
index 95e9c95..ee18624 100644
--- a/ch341a_spi.c
+++ b/ch341a_spi.c
@@ -441,7 +441,12 @@
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;

To view, visit change 25681. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib71ebe812316eaf49136979a942a946ef9e4d487
Gerrit-Change-Number: 25681
Gerrit-PatchSet: 4
Gerrit-Owner: Alex James <theracermaster@gmail.com>
Gerrit-Reviewer: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-Reviewer: Urja Rannikko <urjaman@gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>