diff options
author | Markus Armbruster | 2020-06-10 07:32:12 +0200 |
---|---|---|
committer | Markus Armbruster | 2020-06-15 22:05:28 +0200 |
commit | 57d479c9c6c69cd856f77360e116f25e73e40566 (patch) | |
tree | 124809c7c4f83d44187bc6e599e70fc28e76b431 /hw/microblaze | |
parent | ssi: ssi_auto_connect_slaves() never does anything, drop (diff) | |
download | qemu-57d479c9c6c69cd856f77360e116f25e73e40566.tar.gz qemu-57d479c9c6c69cd856f77360e116f25e73e40566.tar.xz qemu-57d479c9c6c69cd856f77360e116f25e73e40566.zip |
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>
Diffstat (limited to 'hw/microblaze')
-rw-r--r-- | hw/microblaze/petalogix_ml605_mmu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c index 2e7a3fa119..d4bfa233c9 100644 --- a/hw/microblaze/petalogix_ml605_mmu.c +++ b/hw/microblaze/petalogix_ml605_mmu.c @@ -186,12 +186,12 @@ petalogix_ml605_init(MachineState *machine) DriveInfo *dinfo = drive_get_next(IF_MTD); qemu_irq cs_line; - dev = ssi_create_slave_no_init(spi, "n25q128"); + dev = qdev_new("n25q128"); if (dinfo) { qdev_prop_set_drive(dev, "drive", blk_by_legacy_dinfo(dinfo), &error_fatal); } - qdev_init_nofail(dev); + qdev_realize_and_unref(dev, BUS(spi), &error_fatal); cs_line = qdev_get_gpio_in_named(dev, SSI_GPIO_CS, 0); sysbus_connect_irq(busdev, i+1, cs_line); |