diff mbox series

[oe,meta-oe,4/8] flashrom: Fix build with libusb 1.0.22

Message ID 20180512030758.31409-4-raj.khem@gmail.com
State Accepted
Commit 28abd55f75feb2d9d36dc0d5b704728032f5e33e
Headers show
Series [oe,meta-networking,1/8] netkit-rusers: Fix build when libc does not have nis builtin | expand

Commit Message

Khem Raj May 12, 2018, 3:07 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...pi-Avoid-deprecated-libusb-functions.patch | 39 +++++++++++++++++++
 meta-oe/recipes-bsp/flashrom/flashrom_1.0.bb  |  1 +
 2 files changed, 40 insertions(+)
 create mode 100644 meta-oe/recipes-bsp/flashrom/flashrom/0001-ch341a_spi-Avoid-deprecated-libusb-functions.patch

-- 
2.17.0

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-oe/recipes-bsp/flashrom/flashrom/0001-ch341a_spi-Avoid-deprecated-libusb-functions.patch b/meta-oe/recipes-bsp/flashrom/flashrom/0001-ch341a_spi-Avoid-deprecated-libusb-functions.patch
new file mode 100644
index 0000000000..df8028627a
--- /dev/null
+++ b/meta-oe/recipes-bsp/flashrom/flashrom/0001-ch341a_spi-Avoid-deprecated-libusb-functions.patch
@@ -0,0 +1,39 @@ 
+From e5f68189ab3602b1042cc8423fd6a3a23abd5455 Mon Sep 17 00:00:00 2001
+From: Alex James <theracermaster@gmail.com>
+Date: Sat, 14 Apr 2018 22:59:57 -0500
+Subject: [PATCH] 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>
+---
+Upstream-Status: Backport
+ ch341a_spi.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/ch341a_spi.c b/ch341a_spi.c
+index 6eb2804..d880510 100644
+--- a/ch341a_spi.c
++++ b/ch341a_spi.c
+@@ -444,7 +444,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;
+-- 
+2.17.0
+
diff --git a/meta-oe/recipes-bsp/flashrom/flashrom_1.0.bb b/meta-oe/recipes-bsp/flashrom/flashrom_1.0.bb
index 9eac876ba1..1c17246681 100644
--- a/meta-oe/recipes-bsp/flashrom/flashrom_1.0.bb
+++ b/meta-oe/recipes-bsp/flashrom/flashrom_1.0.bb
@@ -8,6 +8,7 @@  DEPENDS = "pciutils libusb libusb-compat"
 SRC_URI = "https://download.flashrom.org/releases/flashrom-${PV}.tar.bz2 \
            file://sst26.patch \
            file://0001-platform-Add-riscv-to-known-platforms.patch \
+           file://0001-ch341a_spi-Avoid-deprecated-libusb-functions.patch \
            "
 SRC_URI[md5sum] = "42d999990c735d88653627cefcc13b9a"
 SRC_URI[sha256sum] = "3702fa215ba5fb5af8e54c852d239899cfa1389194c1e51cb2a170c4dc9dee64"