aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-02-23 13:44:04 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-02-27 09:37:21 +0100
commitccced963c508cf479e1d39bb7efc63be50f5a63d (patch)
tree28888db8c4bbb7c1a549cc97e2031cde54758f26 /hw
parentae1011d43026cb72362cef139ed401d9ad0a1696 (diff)
hw/usb: remove usb_bus_find
Inline the sole remaining use, which is for the -usbdevice command line. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20240223124406.234509-9-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb/bus.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 76fda41b7e..796769fadb 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -100,19 +100,6 @@ void usb_bus_release(USBBus *bus)
QTAILQ_REMOVE(&busses, bus, next);
}
-USBBus *usb_bus_find(int busnr)
-{
- USBBus *bus;
-
- if (-1 == busnr)
- return QTAILQ_FIRST(&busses);
- QTAILQ_FOREACH(bus, &busses, next) {
- if (bus->busnr == busnr)
- return bus;
- }
- return NULL;
-}
-
static void usb_device_realize(USBDevice *dev, Error **errp)
{
USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev);
@@ -643,7 +630,7 @@ HumanReadableText *qmp_x_query_usb(Error **errp)
/* handle legacy -usbdevice cmd line option */
USBDevice *usbdevice_create(const char *driver)
{
- USBBus *bus = usb_bus_find(-1 /* any */);
+ USBBus *bus = QTAILQ_FIRST(&busses);
LegacyUSBFactory *f = NULL;
Error *err = NULL;
GSList *i;