aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/bus.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-01-29 14:05:29 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2024-02-16 13:56:09 +0100
commit726c60993689790b515b20603f3710b2b0418ee9 (patch)
treef841136ff8d1b147b2b741dec5a5a0ad00302acf /hw/usb/bus.c
parent99d0dcd7f102c07a510200d768cae65e5db25d23 (diff)
downloadqemu-726c60993689790b515b20603f3710b2b0418ee9.zip
qemu-726c60993689790b515b20603f3710b2b0418ee9.tar.gz
qemu-726c60993689790b515b20603f3710b2b0418ee9.tar.bz2
usb: inline device creation functions
Allow boards to use the device creation functions even if USB itself is not available; of course the functions will fail inexorably, but this can be okay if the calls are conditional on the existence of some USB host controller device. This is for example the case for hw/mips/loongson3_virt.c. Acked-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/usb/bus.c')
-rw-r--r--hw/usb/bus.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 59c3994..76fda41 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -329,29 +329,6 @@ void usb_legacy_register(const char *typename, const char *usbdevice_name,
}
}
-USBDevice *usb_new(const char *name)
-{
- return USB_DEVICE(qdev_new(name));
-}
-
-static USBDevice *usb_try_new(const char *name)
-{
- return USB_DEVICE(qdev_try_new(name));
-}
-
-bool usb_realize_and_unref(USBDevice *dev, USBBus *bus, Error **errp)
-{
- return qdev_realize_and_unref(&dev->qdev, &bus->qbus, errp);
-}
-
-USBDevice *usb_create_simple(USBBus *bus, const char *name)
-{
- USBDevice *dev = usb_new(name);
-
- usb_realize_and_unref(dev, bus, &error_abort);
- return dev;
-}
-
static void usb_fill_port(USBPort *port, void *opaque, int index,
USBPortOps *ops, int speedmask)
{