diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index b950501d10..295d20227a 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -941,7 +941,8 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev, int hostfd) usb_host_ep_update(s); libusb_speed = libusb_get_device_speed(dev); -#if LIBUSB_API_VERSION >= 0x01000107 && defined(CONFIG_LINUX) +#if LIBUSB_API_VERSION >= 0x01000107 && defined(CONFIG_LINUX) && \ + defined(USBDEVFS_GET_SPEED) if (hostfd && libusb_speed == 0) { /* * Workaround libusb bug: libusb_get_device_speed() does not