You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.2 KiB

  1. From 291764a70e6d8b212680e311bfb0825abf2b9a2f Mon Sep 17 00:00:00 2001
  2. From: Alex James <theracermaster@gmail.com>
  3. Date: Sat, 14 Apr 2018 22:59:57 -0500
  4. Subject: ch341a_spi: Avoid deprecated libusb functions
  5. libusb 1.0.22 marked libusb_set_debug as deprecated. For such versions
  6. of libusb, use libusb_set_option instead.
  7. Change-Id: Ib71ebe812316eaf49136979a942a946ef9e4d487
  8. Signed-off-by: Alex James <theracermaster@gmail.com>
  9. Reviewed-on: https://review.coreboot.org/25681
  10. Tested-by: Nico Huber <nico.h@gmx.de>
  11. Reviewed-by: David Hendricks <david.hendricks@gmail.com>
  12. ---
  13. ch341a_spi.c | 7 ++++++-
  14. 1 file changed, 6 insertions(+), 1 deletion(-)
  15. (limited to 'ch341a_spi.c')
  16. diff --git a/ch341a_spi.c b/ch341a_spi.c
  17. index 95e9c95..ee18624 100644
  18. --- a/ch341a_spi.c
  19. +++ b/ch341a_spi.c
  20. @@ -444,7 +444,12 @@ int ch341a_spi_init(void)
  21. return -1;
  22. }
  23. - libusb_set_debug(NULL, 3); // Enable information, warning and error messages (only).
  24. + /* Enable information, warning, and error messages (only). */
  25. +#if LIBUSB_API_VERSION < 0x01000106
  26. + libusb_set_debug(NULL, 3);
  27. +#else
  28. + libusb_set_option(NULL, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_INFO);
  29. +#endif
  30. uint16_t vid = devs_ch341a_spi[0].vendor_id;
  31. uint16_t pid = devs_ch341a_spi[0].device_id;
  32. --
  33. cgit v1.1