From 4f67d30b5e74e060b8dbe10528829b47345cd6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 10 Jan 2020 19:30:32 +0400 Subject: qdev: set properties with device_class_set_props() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following patch will need to handle properties registration during class_init time. Let's use a device_class_set_props() setter. spatch --macro-file scripts/cocci-macro-file.h --sp-file ./scripts/coccinelle/qdev-set-props.cocci --keep-comments --in-place --dir . @@ typedef DeviceClass; DeviceClass *d; expression val; @@ - d->props = val + device_class_set_props(d, val) Signed-off-by: Marc-André Lureau Message-Id: <20200110153039.1379601-20-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- hw/ppc/pnv.c | 2 +- hw/ppc/pnv_core.c | 4 ++-- hw/ppc/pnv_homer.c | 2 +- hw/ppc/pnv_lpc.c | 2 +- hw/ppc/pnv_occ.c | 2 +- hw/ppc/pnv_pnor.c | 2 +- hw/ppc/pnv_psi.c | 2 +- hw/ppc/ppc440_uc.c | 2 +- hw/ppc/prep_systemio.c | 2 +- hw/ppc/rs6000_mc.c | 2 +- hw/ppc/spapr_cpu_core.c | 2 +- hw/ppc/spapr_pci.c | 2 +- hw/ppc/spapr_rng.c | 2 +- hw/ppc/spapr_tpm_proxy.c | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) (limited to 'hw/ppc') diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index e2735bb8dd..e61994cf5a 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1614,7 +1614,7 @@ static void pnv_chip_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_CPU, dc->categories); dc->realize = pnv_chip_realize; - dc->props = pnv_chip_properties; + device_class_set_props(dc, pnv_chip_properties); dc->desc = "PowerNV Chip"; } diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c index 2651044278..8ca5fbd1a9 100644 --- a/hw/ppc/pnv_core.c +++ b/hw/ppc/pnv_core.c @@ -323,7 +323,7 @@ static void pnv_core_class_init(ObjectClass *oc, void *data) dc->realize = pnv_core_realize; dc->unrealize = pnv_core_unrealize; - dc->props = pnv_core_properties; + device_class_set_props(dc, pnv_core_properties); } #define DEFINE_PNV_CORE_TYPE(family, cpu_model) \ @@ -421,7 +421,7 @@ static void pnv_quad_class_init(ObjectClass *oc, void *data) DeviceClass *dc = DEVICE_CLASS(oc); dc->realize = pnv_quad_realize; - dc->props = pnv_quad_properties; + device_class_set_props(dc, pnv_quad_properties); } static const TypeInfo pnv_quad_info = { diff --git a/hw/ppc/pnv_homer.c b/hw/ppc/pnv_homer.c index a08b7914f7..93ae42f7e4 100644 --- a/hw/ppc/pnv_homer.c +++ b/hw/ppc/pnv_homer.c @@ -359,7 +359,7 @@ static void pnv_homer_class_init(ObjectClass *klass, void *data) dc->realize = pnv_homer_realize; dc->desc = "PowerNV HOMER Memory"; - dc->props = pnv_homer_properties; + device_class_set_props(dc, pnv_homer_properties); } static const TypeInfo pnv_homer_type_info = { diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c index 18256d9ba3..22b205532b 100644 --- a/hw/ppc/pnv_lpc.c +++ b/hw/ppc/pnv_lpc.c @@ -761,7 +761,7 @@ static void pnv_lpc_class_init(ObjectClass *klass, void *data) dc->realize = pnv_lpc_realize; dc->desc = "PowerNV LPC Controller"; - dc->props = pnv_lpc_properties; + device_class_set_props(dc, pnv_lpc_properties); } static const TypeInfo pnv_lpc_info = { diff --git a/hw/ppc/pnv_occ.c b/hw/ppc/pnv_occ.c index 924fdabc9e..2173fac0e7 100644 --- a/hw/ppc/pnv_occ.c +++ b/hw/ppc/pnv_occ.c @@ -279,7 +279,7 @@ static void pnv_occ_class_init(ObjectClass *klass, void *data) dc->realize = pnv_occ_realize; dc->desc = "PowerNV OCC Controller"; - dc->props = pnv_occ_properties; + device_class_set_props(dc, pnv_occ_properties); } static const TypeInfo pnv_occ_type_info = { diff --git a/hw/ppc/pnv_pnor.c b/hw/ppc/pnv_pnor.c index b061106d1c..f761d8dc26 100644 --- a/hw/ppc/pnv_pnor.c +++ b/hw/ppc/pnv_pnor.c @@ -121,7 +121,7 @@ static void pnv_pnor_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = pnv_pnor_realize; - dc->props = pnv_pnor_properties; + device_class_set_props(dc, pnv_pnor_properties); } static const TypeInfo pnv_pnor_info = { diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c index 1d8da31738..6baf9503a1 100644 --- a/hw/ppc/pnv_psi.c +++ b/hw/ppc/pnv_psi.c @@ -937,7 +937,7 @@ static void pnv_psi_class_init(ObjectClass *klass, void *data) xdc->dt_xscom = pnv_psi_dt_xscom; dc->desc = "PowerNV PSI Controller"; - dc->props = pnv_psi_properties; + device_class_set_props(dc, pnv_psi_properties); dc->reset = pnv_psi_reset; } diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index 95475c9c5f..1a6a8fac22 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -1296,7 +1296,7 @@ static void ppc460ex_pcie_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->realize = ppc460ex_pcie_realize; - dc->props = ppc460ex_pcie_props; + device_class_set_props(dc, ppc460ex_pcie_props); dc->hotpluggable = false; } diff --git a/hw/ppc/prep_systemio.c b/hw/ppc/prep_systemio.c index 86e83e278f..bbc51b6e9a 100644 --- a/hw/ppc/prep_systemio.c +++ b/hw/ppc/prep_systemio.c @@ -289,7 +289,7 @@ static void prep_systemio_class_initfn(ObjectClass *klass, void *data) dc->realize = prep_systemio_realize; dc->vmsd = &vmstate_prep_systemio; - dc->props = prep_systemio_properties; + device_class_set_props(dc, prep_systemio_properties); } static TypeInfo prep_systemio800_info = { diff --git a/hw/ppc/rs6000_mc.c b/hw/ppc/rs6000_mc.c index 66b14db5fa..f8a498bd8a 100644 --- a/hw/ppc/rs6000_mc.c +++ b/hw/ppc/rs6000_mc.c @@ -222,7 +222,7 @@ static void rs6000mc_class_initfn(ObjectClass *klass, void *data) dc->realize = rs6000mc_realize; dc->vmsd = &vmstate_rs6000mc; - dc->props = rs6000mc_properties; + device_class_set_props(dc, rs6000mc_properties); } static const TypeInfo rs6000mc_info = { diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index 8339c4c0f8..d09125d9af 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -383,7 +383,7 @@ static void spapr_cpu_core_class_init(ObjectClass *oc, void *data) dc->realize = spapr_cpu_core_realize; dc->unrealize = spapr_cpu_core_unrealize; dc->reset = spapr_cpu_core_reset; - dc->props = spapr_cpu_core_properties; + device_class_set_props(dc, spapr_cpu_core_properties); scc->cpu_type = data; } diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 723373de73..e82bfc5ca7 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -2217,7 +2217,7 @@ static void spapr_phb_class_init(ObjectClass *klass, void *data) hc->root_bus_path = spapr_phb_root_bus_path; dc->realize = spapr_phb_realize; dc->unrealize = spapr_phb_unrealize; - dc->props = spapr_phb_properties; + device_class_set_props(dc, spapr_phb_properties); dc->reset = spapr_phb_reset; dc->vmsd = &vmstate_spapr_pci; /* Supported by TYPE_SPAPR_MACHINE */ diff --git a/hw/ppc/spapr_rng.c b/hw/ppc/spapr_rng.c index 954e4aec4b..e8e8d65ec0 100644 --- a/hw/ppc/spapr_rng.c +++ b/hw/ppc/spapr_rng.c @@ -146,7 +146,7 @@ static void spapr_rng_class_init(ObjectClass *oc, void *data) dc->realize = spapr_rng_realize; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - dc->props = spapr_rng_properties; + device_class_set_props(dc, spapr_rng_properties); dc->hotpluggable = false; } diff --git a/hw/ppc/spapr_tpm_proxy.c b/hw/ppc/spapr_tpm_proxy.c index ca1caec113..991615d77a 100644 --- a/hw/ppc/spapr_tpm_proxy.c +++ b/hw/ppc/spapr_tpm_proxy.c @@ -159,7 +159,7 @@ static void spapr_tpm_proxy_class_init(ObjectClass *k, void *data) dk->realize = spapr_tpm_proxy_realize; dk->unrealize = spapr_tpm_proxy_unrealize; dk->user_creatable = true; - dk->props = spapr_tpm_proxy_properties; + device_class_set_props(dk, spapr_tpm_proxy_properties); } static const TypeInfo spapr_tpm_proxy_info = { -- cgit v1.2.3