qemu-e2k/hw/rtc
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 hw: rtc: Add Goldfish RTC device 2020-02-10 12:01:37 -08:00
Makefile.objs hw/arm/allwinner: add RTC device support 2020-03-12 16:27:33 +00:00
allwinner-rtc.c hw/arm/allwinner: add RTC device support 2020-03-12 16:27:33 +00:00
aspeed_rtc.c hw: Move Aspeed RTC from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:31:44 +02:00
ds1338.c hw: Move DS1338 device from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:26:35 +02:00
exynos4210_rtc.c hw: Move Exynos4210 RTC from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:29:18 +02:00
goldfish_rtc.c hw: rtc: Add Goldfish RTC device 2020-02-10 12:01:37 -08:00
m41t80.c hw: Move M41T80 device from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:22:12 +02:00
m48t59-internal.h hw/timer/m48t59: Convert debug printf()s to trace events 2020-02-06 10:51:24 +01:00
m48t59-isa.c isa: Convert uses of isa_create() with Coccinelle 2020-06-15 22:05:28 +02:00
m48t59.c sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
mc146818rtc.c isa: Convert uses of isa_create() with Coccinelle 2020-06-15 22:05:28 +02:00
pl031.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
sun4v-rtc.c sysbus: Convert to sysbus_realize() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
trace-events hw/arm/allwinner: add RTC device support 2020-03-12 16:27:33 +00:00
twl92230.c hw/timer: Remove unused "ui/console.h" header 2020-03-09 15:59:31 +01:00
xlnx-zynqmp-rtc.c hw/rtc/xlnx-zynqmp-rtc: Remove unused "ptimer.h" include 2019-10-24 20:34:12 +02:00