[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 4/8] usb-host: restrict workaround to new libusb versions
From: |
Alex Bennée |
Subject: |
[PATCH v1 4/8] usb-host: restrict workaround to new libusb versions |
Date: |
Thu, 3 Sep 2020 12:21:03 +0100 |
From: Gerd Hoffmann <kraxel@redhat.com>
Fixes build failures with old kernels (USBDEVFS_GET_SPEED missing),
on the assumtion that distros with old kernels also have old libusb.
Reported-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200902081445.3291-1-kraxel@redhat.com>
---
hw/usb/host-libusb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 08604f787fd..c5d38cb09c0 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -942,7 +942,7 @@ static int usb_host_open(USBHostDevice *s, libusb_device
*dev, int hostfd)
usb_host_ep_update(s);
libusb_speed = libusb_get_device_speed(dev);
-#ifdef CONFIG_LINUX
+#if LIBUSB_API_VERSION >= 0x01000107 && defined(CONFIG_LINUX)
if (hostfd && libusb_speed == 0) {
/*
* Workaround libusb bug: libusb_get_device_speed() does not
--
2.20.1
- [PATCH v1 0/8] some testing and CI updates (re-greening), Alex Bennée, 2020/09/03
- [PATCH v1 1/8] CODING_STYLE.rst: flesh out our naming conventions., Alex Bennée, 2020/09/03
- [PATCH v1 2/8] crypto: fix build with gcrypt enabled, Alex Bennée, 2020/09/03
- [PATCH v1 3/8] tests/docker: add python3-setuptools the docker images, Alex Bennée, 2020/09/03
- [PATCH v1 4/8] usb-host: restrict workaround to new libusb versions,
Alex Bennée <=
- [PATCH v1 5/8] qemu-iotests: move check-block back to Makefiles, Alex Bennée, 2020/09/03
- [PATCH v1 8/8] migration: use pstrcpy to copy run state, Alex Bennée, 2020/09/03
- [PATCH v1 6/8] tests/meson.build: fp tests don't need CONFIG_TCG, Alex Bennée, 2020/09/03