[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/49] hw/usb: Inline usb_new()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 06/49] hw/usb: Inline usb_new() |
Date: |
Sun, 12 Jan 2025 23:16:42 +0100 |
Inline the 3 uses of usb_new().
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240216110313.17039-11-philmd@linaro.org>
---
include/hw/usb.h | 7 +------
hw/usb/bus.c | 3 ++-
hw/usb/dev-serial.c | 2 +-
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/include/hw/usb.h b/include/hw/usb.h
index bb778cb844b..e410693d0c6 100644
--- a/include/hw/usb.h
+++ b/include/hw/usb.h
@@ -579,11 +579,6 @@ void usb_pcap_init(FILE *fp);
void usb_pcap_ctrl(USBPacket *p, bool setup);
void usb_pcap_data(USBPacket *p, bool setup);
-static inline USBDevice *usb_new(const char *name)
-{
- return USB_DEVICE(qdev_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);
@@ -591,7 +586,7 @@ static inline bool usb_realize_and_unref(USBDevice *dev,
USBBus *bus, Error **er
static inline 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;
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 7e7deaadcaf..f45b82c776d 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -662,7 +662,8 @@ 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 a0821db902f..aa50a92e26f 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.47.1
- Re: [PULL 04/49] hw: Add QOM parentship relation with CPUs, (continued)
- Re: [PULL 04/49] hw: Add QOM parentship relation with CPUs, Philippe Mathieu-Daudé, 2025/01/13
- Re: [PULL 04/49] hw: Add QOM parentship relation with CPUs, Igor Mammedov, 2025/01/14
- Re: [PULL 04/49] hw: Add QOM parentship relation with CPUs, Markus Armbruster, 2025/01/14
- Re: [PULL 04/49] hw: Add QOM parentship relation with CPUs, Igor Mammedov, 2025/01/15
- Re: [PULL 04/49] hw: Add QOM parentship relation with CPUs, Peter Xu, 2025/01/15
- Re: [PULL 04/49] hw: Add QOM parentship relation with CPUs, Zhao Liu, 2025/01/14
- Re: [PULL 04/49] hw: Add QOM parentship relation with CPUs, Igor Mammedov, 2025/01/15
- Re: [PULL 04/49] hw: Add QOM parentship relation with CPUs, Zhao Liu, 2025/01/15
[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é <=
[PULL 08/49] hw/net/xilinx_ethlite: Map MDIO registers (as unimplemented), Philippe Mathieu-Daudé, 2025/01/12
[PULL 09/49] hw/net/xilinx_ethlite: Introduce txbuf_ptr() helper, Philippe Mathieu-Daudé, 2025/01/12
[PULL 10/49] hw/net/xilinx_ethlite: Introduce rxbuf_ptr() helper, Philippe Mathieu-Daudé, 2025/01/12
[PULL 11/49] hw/net/xilinx_ethlite: Access TX_GIE register for each port, Philippe Mathieu-Daudé, 2025/01/12
[PULL 12/49] hw/net/xilinx_ethlite: Access TX_LEN register for each port, Philippe Mathieu-Daudé, 2025/01/12
[PULL 13/49] hw/net/xilinx_ethlite: Access TX_CTRL register for each port, Philippe Mathieu-Daudé, 2025/01/12
[PULL 14/49] hw/net/xilinx_ethlite: Map RX_CTRL as MMIO, Philippe Mathieu-Daudé, 2025/01/12
[PULL 15/49] hw/net/xilinx_ethlite: Map TX_LEN as MMIO, Philippe Mathieu-Daudé, 2025/01/12
[PULL 16/49] hw/net/xilinx_ethlite: Map TX_GIE as MMIO, Philippe Mathieu-Daudé, 2025/01/12
[PULL 17/49] hw/net/xilinx_ethlite: Map TX_CTRL as MMIO, Philippe Mathieu-Daudé, 2025/01/12