Skip to contentSkip to conversation

hw/usb: Disable 'usb-host' device when no USB is available in the target

PATCH New Thomas Huth 1 participant 1 message Sep 8, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/usb: Disable 'usb-host' device when no USB is available in the target

The 'usb-host' device currently also shows up in the "-device help" list of all targets that do not support USB. That's ugly and kind of confusing for the users. We should only provide this device if both, the host and the target support USB.

---
 hw/usb/Makefile.objs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
hw/usb/Makefile.objs +3 -1
index 97f1c456..323d448 100644
@@ -38,7 +38,9 @@ endif
 common-obj-$(CONFIG_USB_REDIR) += redirect.o quirks.o
 
 # usb pass-through
-common-obj-y += $(patsubst %,host-%.o,$(HOST_USB))
+common-obj-$(CONFIG_USB) += $(patsubst %,host-%.o,$(HOST_USB))
+common-obj-$(call lnot,$(CONFIG_USB)) += host-stub.o
+common-obj-$(CONFIG_ALL) += host-stub.o
 
 ifeq ($(CONFIG_USB_LIBUSB),y)
 common-obj-$(CONFIG_XEN) += xen-usb.o
Signature · 1 line
1.8.3.1