qemu-e2k/include/hw/timer
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
..
a9gtimer.h
allwinner-a10-pit.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
arm_mptimer.h
armv7m_systick.h arm: Move system_clock_scale to armv7m_systick.h 2019-05-23 14:47:43 +01:00
aspeed_timer.h aspeed/timer: Add support for IRQ status register on the AST2600 2019-10-15 18:09:04 +01:00
bcm2835_systmr.h hw/timer/bcm2835: Add the BCM2835 SYS_timer 2019-10-25 13:09:27 +01:00
cmsdk-apb-dualtimer.h
cmsdk-apb-timer.h qdev: Convert uses of qdev_create() with Coccinelle 2020-06-15 22:00:10 +02:00
digic-timer.h
hpet.h
i8254_internal.h Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
i8254.h isa: Convert uses of isa_create() with Coccinelle 2020-06-15 22:05:28 +02:00
imx_epit.h
imx_gpt.h
mips_gictimer.h
mss-timer.h hw/timer/mss-timerc: Switch to transaction-based ptimer API 2019-10-15 18:09:03 +01:00
nrf51_timer.h hw/timer/nrf51_timer: Display timer ID in trace events 2020-05-11 11:05:52 +01:00
stm32f2xx_timer.h Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00