[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/49] hw/usb: Inline usb_try_new()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 05/49] hw/usb: Inline usb_try_new() |
Date: |
Sun, 12 Jan 2025 23:16:41 +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>
---
include/hw/usb.h | 5 -----
hw/usb/bus.c | 2 +-
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/include/hw/usb.h b/include/hw/usb.h
index d46d96779ad..bb778cb844b 100644
--- a/include/hw/usb.h
+++ b/include/hw/usb.h
@@ -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);
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index b19b0b13ebd..7e7deaadcaf 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -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);
}
--
2.47.1
[PULL 03/49] hw: Replace DEVICE(object_new) -> qdev_new(), Philippe Mathieu-Daudé, 2025/01/12
[PULL 07/49] hw/microblaze: Restrict MemoryRegionOps are implemented as 32-bit, Philippe Mathieu-Daudé, 2025/01/12
[PULL 06/49] hw/usb: Inline usb_new(), Philippe Mathieu-Daudé, 2025/01/12
[PULL 08/49] hw/net/xilinx_ethlite: Map MDIO registers (as unimplemented), Philippe Mathieu-Daudé, 2025/01/12