diff options
author | Markus Armbruster | 2020-06-10 07:32:34 +0200 |
---|---|---|
committer | Markus Armbruster | 2020-06-15 22:05:28 +0200 |
commit | 3c6ef471ee67bf5a22a9e0ecfdc45ca7d2393216 (patch) | |
tree | 300f0113474324b52f15500b1a80ee7e33872668 /hw/display/sm501.c | |
parent | sysbus: New sysbus_realize(), sysbus_realize_and_unref() (diff) | |
download | qemu-3c6ef471ee67bf5a22a9e0ecfdc45ca7d2393216.tar.gz qemu-3c6ef471ee67bf5a22a9e0ecfdc45ca7d2393216.tar.xz qemu-3c6ef471ee67bf5a22a9e0ecfdc45ca7d2393216.zip |
sysbus: Convert to sysbus_realize() etc. with Coccinelle
Convert from qdev_realize(), qdev_realize_and_unref() with null @bus
argument to sysbus_realize(), sysbus_realize_and_unref().
Coccinelle script:
@@
expression dev, errp;
@@
- qdev_realize(DEVICE(dev), NULL, errp);
+ sysbus_realize(SYS_BUS_DEVICE(dev), errp);
@@
expression sysbus_dev, dev, errp;
@@
+ sysbus_dev = SYS_BUS_DEVICE(dev);
- qdev_realize_and_unref(dev, NULL, errp);
+ sysbus_realize_and_unref(sysbus_dev, errp);
- sysbus_dev = SYS_BUS_DEVICE(dev);
@@
expression sysbus_dev, dev, errp;
expression expr;
@@
sysbus_dev = SYS_BUS_DEVICE(dev);
... when != dev = expr;
- qdev_realize_and_unref(dev, NULL, errp);
+ sysbus_realize_and_unref(sysbus_dev, errp);
@@
expression dev, errp;
@@
- qdev_realize_and_unref(DEVICE(dev), NULL, errp);
+ sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), errp);
@@
expression dev, errp;
@@
- qdev_realize_and_unref(dev, NULL, errp);
+ sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), errp);
Whitespace changes minimized manually.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-46-armbru@redhat.com>
[Conflicts in hw/misc/empty_slot.c and hw/sparc/leon3.c resolved]
Diffstat (limited to 'hw/display/sm501.c')
-rw-r--r-- | hw/display/sm501.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/display/sm501.c b/hw/display/sm501.c index ccdbce1a06..80da8575fe 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -1971,7 +1971,7 @@ static void sm501_realize_sysbus(DeviceState *dev, Error **errp) usb_dev = qdev_new("sysbus-ohci"); qdev_prop_set_uint32(usb_dev, "num-ports", 2); qdev_prop_set_uint64(usb_dev, "dma-offset", s->base); - qdev_realize_and_unref(usb_dev, NULL, &error_fatal); + sysbus_realize_and_unref(SYS_BUS_DEVICE(usb_dev), &error_fatal); memory_region_add_subregion(&s->state.mmio_region, SM501_USB_HOST, sysbus_mmio_get_region(SYS_BUS_DEVICE(usb_dev), 0)); sysbus_pass_irq(sbd, SYS_BUS_DEVICE(usb_dev)); |