[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/21] hw/usb: Inline usb_new()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 10/21] hw/usb: Inline usb_new() |
Date: |
Fri, 16 Feb 2024 12:03:01 +0100 |
Inline the 2 uses of usb_new().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/usb.h | 1 -
hw/usb/bus.c | 9 ++-------
hw/usb/dev-serial.c | 2 +-
3 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/include/hw/usb.h b/include/hw/usb.h
index 32c23a5ca2..2d820685cc 100644
--- a/include/hw/usb.h
+++ b/include/hw/usb.h
@@ -500,7 +500,6 @@ void usb_bus_release(USBBus *bus);
USBBus *usb_bus_find(int busnr);
void usb_legacy_register(const char *typename, const char *usbdevice_name,
USBDevice *(*usbdevice_init)(void));
-USBDevice *usb_new(const char *name);
bool usb_realize_and_unref(USBDevice *dev, USBBus *bus, Error **errp);
USBDevice *usb_create_simple(USBBus *bus, const char *name);
USBDevice *usbdevice_create(const char *cmdline);
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 148224f06a..a599e2552b 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -329,11 +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));
-}
-
bool usb_realize_and_unref(USBDevice *dev, USBBus *bus, Error **errp)
{
return qdev_realize_and_unref(&dev->qdev, &bus->qbus, errp);
@@ -341,7 +336,7 @@ bool usb_realize_and_unref(USBDevice *dev, USBBus *bus,
Error **errp)
USBDevice *usb_create_simple(USBBus *bus, const char *name)
{
- USBDevice *dev = usb_new(name);
+ USBDevice *dev = USB_DEVICE(qdev_new(name));
usb_realize_and_unref(dev, bus, &error_abort);
return dev;
@@ -693,7 +688,7 @@ USBDevice *usbdevice_create(const char *driver)
return NULL;
}
- dev = f->usbdevice_init ? f->usbdevice_init() : usb_new(f->name);
+ dev = f->usbdevice_init ? f->usbdevice_init() :
USB_DEVICE(qdev_new(f->name));
if (!dev) {
error_report("Failed to create USB device '%s'", f->name);
return NULL;
diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c
index 63047d79cf..6e79c46d53 100644
--- a/hw/usb/dev-serial.c
+++ b/hw/usb/dev-serial.c
@@ -624,7 +624,7 @@ static USBDevice *usb_braille_init(void)
return NULL;
}
- dev = usb_new("usb-braille");
+ dev = USB_DEVICE(qdev_new("usb-braille"));
qdev_prop_set_chr(&dev->qdev, "chardev", cdrv);
return dev;
}
--
2.41.0
- Re: [PATCH 04/21] hw/tricore/testboard: Use qdev_new() instead of QOM basic API, (continued)
- [PATCH 05/21] hw/ppc/pnv_bmc: Use qdev_new() instead of QOM API, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 06/21] hw: Replace DEVICE(object_new) -> qdev_new(), Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 07/21] target: Replace DEVICE(object_new) -> qdev_new(), Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 09/21] hw/usb: Inline usb_try_new(), Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 08/21] hw/isa: Inline isa_try_new(), Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 10/21] hw/usb: Inline usb_new(),
Philippe Mathieu-Daudé <=
- [PATCH 11/21] hw/usb: Add QOM parentship relation with hub devices, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 12/21] hw/pci-host/q35: Update q35_host_props[] comment, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 13/21] hw/pci-host/raven: Embedded OrIRQ in PRePPCIState, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 14/21] hw/pci-host/raven: Prefer object_initialize_child over object_initialize, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 15/21] hw/core/register: Prefer object_initialize_child over object_initialize, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 16/21] hw/net/can/versal: Prefer object_initialize_child over object_initialize, Philippe Mathieu-Daudé, 2024/02/16