qemu-e2k/hw/rtc
Markus Armbruster 96927c744f isa: Convert uses of isa_create() with Coccinelle
Replace

    dev = isa_create(bus, type_name);
    ...
    qdev_init_nofail(dev);

by

    dev = isa_new(type_name);
    ...
    isa_realize_and_unref(dev, bus, &error_fatal);

Recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains
why.

Coccinelle script:

    @@
    expression dev, bus, expr;
    expression list args;
    expression d;
    @@
    -    dev = isa_create(bus, args);
    +    dev = isa_new(args);
    (
         d = &dev->qdev;
    |
         d = DEVICE(dev);
    )
         ... when != dev = expr
    -    qdev_init_nofail(d);
    +    isa_realize_and_unref(dev, bus, &error_fatal);

    @@
    expression dev, bus, expr;
    expression list args;
    @@
    -    dev = isa_create(bus, args);
    +    dev = isa_new(args);
         ... when != dev = expr
    -    qdev_init_nofail(DEVICE(dev));
    +    isa_realize_and_unref(dev, bus, &error_fatal);

    @@
    expression dev, bus, expr;
    expression list args;
    @@
    -    dev = DEVICE(isa_create(bus, args));
    +    ISADevice *isa_dev; // TODO move
    +    isa_dev = isa_new(args);
    +    dev = DEVICE(isa_dev);
         ... when != dev = expr
    -    qdev_init_nofail(dev);
    +    isa_realize_and_unref(isa_dev, bus, &error_fatal);

Missing #include "qapi/error.h" added manually, whitespace changes
minimized manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-20-armbru@redhat.com>
2020-06-15 22:05:28 +02:00
..
allwinner-rtc.c hw/arm/allwinner: add RTC device support 2020-03-12 16:27:33 +00:00
aspeed_rtc.c
ds1338.c
exynos4210_rtc.c
goldfish_rtc.c hw: rtc: Add Goldfish RTC device 2020-02-10 12:01:37 -08:00
Kconfig hw: rtc: Add Goldfish RTC device 2020-02-10 12:01:37 -08:00
m41t80.c
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 qdev: Convert uses of qdev_create() with Coccinelle 2020-06-15 22:00:10 +02:00
Makefile.objs hw/arm/allwinner: add RTC device support 2020-03-12 16:27:33 +00: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 qdev: Convert uses of qdev_create() with Coccinelle 2020-06-15 22:00:10 +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