[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 10/21] hw/usb: Inline usb_new()
From: |
Zhao Liu |
Subject: |
Re: [PATCH 10/21] hw/usb: Inline usb_new() |
Date: |
Thu, 22 Feb 2024 17:55:41 +0800 |
On Fri, Feb 16, 2024 at 12:03:01PM +0100, Philippe Mathieu-Daudé wrote:
> Date: Fri, 16 Feb 2024 12:03:01 +0100
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: [PATCH 10/21] hw/usb: Inline usb_new()
> X-Mailer: git-send-email 2.41.0
>
> 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(-)
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
>
> 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
>
>
- [PATCH 05/21] hw/ppc/pnv_bmc: Use qdev_new() instead of QOM 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é, 2024/02/16
- Re: [PATCH 10/21] hw/usb: Inline usb_new(),
Zhao Liu <=
- [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
- [PATCH 17/21] hw/i386/iommu: Prefer object_initialize_child over object_initialize, Philippe Mathieu-Daudé, 2024/02/16