qemu-e2k/hw/pci-bridge
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
..
Kconfig kconfig: add dependencies on CONFIG_MSI_NONBROKEN 2019-03-18 09:39:57 +01:00
Makefile.objs apb: split simba PCI bridge into hw/pci-bridge/simba.c 2018-01-24 19:19:50 +00:00
dec.c pci: Convert uses of pci_create() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
dec.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
gen_pcie_root_port.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
i82801b11.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
ioh3420.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
pci_bridge_dev.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
pci_expander_bridge.c sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
pcie_pci_bridge.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
pcie_root_port.c pcie_root_port: Add hotplug disabling option 2020-03-08 09:18:29 -04:00
simba.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
xio3130_downstream.c pcie_root_port: Add hotplug disabling option 2020-03-08 09:18:29 -04:00
xio3130_upstream.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00