qemu-e2k/hw/xen
Markus Armbruster 3c6ef471ee 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]
2020-06-15 22:05:28 +02:00
..
Makefile.objs xen: fix build without pci passthrough 2020-06-12 11:20:12 -04:00
trace-events xen: perform XenDevice clean-up in XenBus watch handler 2019-09-24 12:18:47 +01:00
xen-backend.c xen: add a mechanism to automatically create XenDevice-s... 2019-01-14 13:45:40 +00:00
xen-bus-helper.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
xen-bus.c sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
xen-host-pci-device.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
xen-host-pci-device.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
xen-legacy-backend.c sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
xen_devconfig.c Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
xen_pt.c xen: fix build without pci passthrough 2020-06-12 11:20:12 -04:00
xen_pt.h xen: fix build without pci passthrough 2020-06-12 11:20:12 -04:00
xen_pt_config_init.c xen: re-name XenDevice to XenLegacyDevice... 2019-01-14 13:45:40 +00:00
xen_pt_graphics.c Avoid cpu_physical_memory_rw() with a constant is_write argument 2020-02-20 14:47:08 +01:00
xen_pt_load_rom.c hw/xen/xen_pt_load_rom: Remove unused includes 2020-02-27 11:50:30 +00:00
xen_pt_msi.c xen: re-name XenDevice to XenLegacyDevice... 2019-01-14 13:45:40 +00:00
xen_pt_stub.c xen: fix build without pci passthrough 2020-06-12 11:20:12 -04:00
xen_pvdev.c Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00