]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
hw/usb: Inline usb_try_new()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Sat, 16 Dec 2023 17:23:26 +0000 (18:23 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 13 Jan 2025 16:07:00 +0000 (17:07 +0100)
Inline the single use of usb_try_new().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20240216110313.17039-10-philmd@linaro.org>

hw/usb/bus.c
include/hw/usb.h

index b19b0b13ebd976c0cce045ba1bfb87d613cfe778..7e7deaadcaf4dcf232ab6e785d4de7027f5dbeaf 100644 (file)
@@ -411,7 +411,7 @@ void usb_claim_port(USBDevice *dev, Error **errp)
     } else {
         if (bus->nfree == 1 && strcmp(object_get_typename(OBJECT(dev)), "usb-hub") != 0) {
             /* Create a new hub and chain it on */
-            hub = usb_try_new("usb-hub");
+            hub = USB_DEVICE(qdev_try_new("usb-hub"));
             if (hub) {
                 usb_realize_and_unref(hub, bus, NULL);
             }
index d46d96779ad2a3bccd91c3c70debb32a025fc67c..bb778cb844bd62a08097dc27df612395ee7c00e7 100644 (file)
@@ -584,11 +584,6 @@ static inline USBDevice *usb_new(const char *name)
     return USB_DEVICE(qdev_new(name));
 }
 
-static inline USBDevice *usb_try_new(const char *name)
-{
-    return USB_DEVICE(qdev_try_new(name));
-}
-
 static inline bool usb_realize_and_unref(USBDevice *dev, USBBus *bus, Error **errp)
 {
     return qdev_realize_and_unref(&dev->qdev, &bus->qbus, errp);