qemu/hw/ppc
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
..
e500-ccsr.h
e500.c qdev: Convert uses of qdev_create() with Coccinelle 2020-06-15 22:00:10 +02:00
e500.h
e500plat.c ppc/e500: use memdev for RAM 2020-02-19 16:50:00 +00:00
fdt.c
fw_cfg.c
Kconfig ppc/pnv: Fix PCI_EXPRESS dependency 2020-02-21 09:15:03 +11:00
mac_newworld.c pci: Convert uses of pci_create() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
mac_oldworld.c pci: Convert uses of pci_create() etc. with Coccinelle 2020-06-15 22:05:28 +02:00
mac.h
Makefile.objs spapr: Add NVDIMM device support 2020-02-21 09:15:04 +11:00
mpc8544_guts.c
mpc8544ds.c ppc/e500: use memdev for RAM 2020-02-19 16:50:00 +00:00
pnv_bmc.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
pnv_core.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
pnv_homer.c ppc/pnv: change the PowerNV machine devices to be non user creatable 2020-02-02 14:07:57 +11:00
pnv_lpc.c hw/ppc/pnv: Fix typo in comment 2020-03-17 09:41:14 +11:00
pnv_occ.c ppc/pnv: change the PowerNV machine devices to be non user creatable 2020-02-02 14:07:57 +11:00
pnv_pnor.c ppc/pnv: improve error logging when a PNOR update fails 2020-02-02 14:07:57 +11:00
pnv_psi.c pnv/psi: Correct the pnv-psi* devices not to be sysbus devices 2020-06-15 21:36:21 +02:00
pnv_xscom.c ppc/pnv: Introduce PnvChipClass::xscom_pcba() method 2019-12-17 10:59:11 +11:00
pnv.c qdev: Convert uses of qdev_set_parent_bus() manually 2020-06-15 22:05:28 +02:00
ppc4xx_devs.c bamboo, sam460ex: Tidy up error message for unsupported RAM size 2020-04-29 08:01:52 +02:00
ppc4xx_pci.c
ppc405_boards.c ppc/ppc405_boards: Remove unnecessary NULL check 2020-03-24 11:56:37 +11:00
ppc405_uc.c
ppc405.h
ppc440_bamboo.c ppc/{ppc440_bamboo, sam460ex}: use memdev for RAM 2020-02-19 16:50:00 +00:00
ppc440_pcix.c
ppc440_uc.c qdev: Convert uses of qdev_create() with Coccinelle 2020-06-15 22:00:10 +02:00
ppc440.h
ppc_booke.c
ppc.c hw/ppc/prep: Remove the deprecated "prep" machine and the OpenHackware BIOS 2020-02-02 14:07:57 +11:00
ppce500_spin.c
prep_systemio.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
prep.c isa: Convert uses of isa_create() with Coccinelle 2020-06-15 22:05:28 +02:00
rs6000_mc.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
sam460ex.c qdev: Convert uses of qdev_create() with Coccinelle 2020-06-15 22:00:10 +02:00
spapr_caps.c Drop more @errp parameters after previous commit 2020-05-15 07:08:14 +02:00
spapr_cpu_core.c ppc/spapr: add a POWER10 CPU model 2020-05-27 15:27:29 +10:00
spapr_drc.c qom: Drop @errp parameter of object_property_del() 2020-05-15 07:08:14 +02:00
spapr_events.c ppc/spapr: Don't kill the guest if a recovered FWNMI machine check delivery fails 2020-04-07 08:55:10 +10:00
spapr_hcall.c spapr: Drop CAS reboot flag 2020-05-07 11:10:50 +10:00
spapr_iommu.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
spapr_irq.c qdev: Convert uses of qdev_create() with Coccinelle 2020-06-15 22:00:10 +02:00
spapr_nvdimm.c spapr_nvdimm: Tweak error messages 2020-05-07 11:10:50 +10:00
spapr_ovec.c spapr: Rename DT functions to newer naming convention 2020-03-17 17:00:19 +11:00
spapr_pci_nvlink2.c error: Clean up unusual names of Error * variables 2019-12-18 08:36:15 +01:00
spapr_pci_vfio.c
spapr_pci.c qdev: Convert to qdev_unrealize() with Coccinelle 2020-06-15 21:36:30 +02:00
spapr_rng.c qom: Drop object_property_set_description() parameter @errp 2020-05-15 07:06:49 +02:00
spapr_rtas_ddw.c
spapr_rtas.c ppc/spapr: Add FWNMI machine check delivery warnings 2020-04-07 08:55:10 +10:00
spapr_rtc.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
spapr_tpm_proxy.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
spapr_vio.c qdev: Convert uses of qdev_create() with Coccinelle 2020-06-15 22:00:10 +02:00
spapr.c qdev: Convert uses of qdev_create() with Coccinelle 2020-06-15 22:00:10 +02:00
trace-events
virtex_ml507.c qdev: Convert uses of qdev_create() with Coccinelle 2020-06-15 22:00:10 +02:00