qemu-e2k/hw/sd
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
..
allwinner-sdhost.c hw/arm/allwinner: add SD/MMC host controller 2020-03-12 16:27:33 +00:00
aspeed_sdhci.c
bcm2835_sdhost.c
core.c
Kconfig
Makefile.objs hw/arm/allwinner: add SD/MMC host controller 2020-03-12 16:27:33 +00:00
milkymist-memcard.c qdev: Convert uses of qdev_create() with Coccinelle 2020-06-15 22:00:10 +02:00
omap_mmc.c add device_legacy_reset function to prepare for reset api change 2020-01-30 16:02:03 +00:00
pl181.c add device_legacy_reset function to prepare for reset api change 2020-01-30 16:02:03 +00:00
pxa2xx_mmci.c sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
sd.c sd: Hide the qdev-but-not-quite thing created by sd_init() 2020-06-15 21:36:30 +02:00
sdhci-internal.h qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
sdhci-pci.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
sdhci.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
sdmmc-internal.c
sdmmc-internal.h
ssi-sd.c qdev: Convert uses of qdev_create() with Coccinelle 2020-06-15 22:00:10 +02:00
trace-events hw/arm/allwinner: add SD/MMC host controller 2020-03-12 16:27:33 +00:00