qemu/hw/microblaze
Markus Armbruster 57d479c9c6 ssi: Convert uses of ssi_create_slave_no_init() with Coccinelle
Replace

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

by

    dev = qdev_new(type_name);
    ...
    qdev_realize_and_unref(dev, bus, &error_fatal);

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

    @@
    type SSIBus;
    identifier bus;
    expression dev, qbus, expr;
    expression list args;
    @@
    -    bus = (SSIBus *)qbus;
    +    bus = qbus; // TODO fix up decl
         ...
    -    dev = ssi_create_slave_no_init(bus, args);
    +    dev = qdev_new(args);
         ... when != dev = expr
    -    qdev_init_nofail(dev);
    +    qdev_realize_and_unref(dev, bus, &error_fatal);

    @@
    expression dev, bus, expr;
    expression list args;
    @@
    -    dev = ssi_create_slave_no_init(bus, args);
    +    dev = qdev_new(args);
         ... when != dev = expr
    -    qdev_init_nofail(dev);
    +    qdev_realize_and_unref(dev, BUS(bus), &error_fatal);

Bus declarations fixed up manually.

Cc: Alistair Francis <alistair@alistair23.me>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-24-armbru@redhat.com>
2020-06-15 22:05:28 +02:00
..
boot.c hw/core/loader: Let load_elf() populate a field with CPU-specific flags 2020-01-29 19:28:52 +01:00
boot.h Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
Kconfig hw/misc: Add a config switch for the "unimplemented" device 2019-08-20 09:11:17 +02:00
Makefile.objs hw/microblaze/Makefile.objs: Create configs for petalogix and xilinx boards 2019-02-05 16:50:19 +01:00
petalogix_ml605_mmu.c ssi: Convert uses of ssi_create_slave_no_init() with Coccinelle 2020-06-15 22:05:28 +02:00
petalogix_s3adsp1800_mmu.c qdev: Convert uses of qdev_create() with Coccinelle 2020-06-15 22:00:10 +02:00
xlnx-zynqmp-pmu.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00