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/cpu/a15mpcore.c | 2 +- hw/cpu/a9mpcore.c | 2 +- hw/cpu/arm11mpcore.c | 2 +- hw/cpu/cluster.c | 2 +- hw/cpu/realview_mpcore.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'hw/cpu') diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c index 7e9983aa19..4f659115b6 100644 --- a/hw/cpu/a15mpcore.c +++ b/hw/cpu/a15mpcore.c @@ -164,7 +164,7 @@ static void a15mp_priv_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = a15mp_priv_realize; - dc->props = a15mp_priv_properties; + device_class_set_props(dc, a15mp_priv_properties); /* We currently have no savable state */ } diff --git a/hw/cpu/a9mpcore.c b/hw/cpu/a9mpcore.c index 6872a3a00a..1f8bc8a196 100644 --- a/hw/cpu/a9mpcore.c +++ b/hw/cpu/a9mpcore.c @@ -175,7 +175,7 @@ static void a9mp_priv_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = a9mp_priv_realize; - dc->props = a9mp_priv_properties; + device_class_set_props(dc, a9mp_priv_properties); } static const TypeInfo a9mp_priv_info = { diff --git a/hw/cpu/arm11mpcore.c b/hw/cpu/arm11mpcore.c index e78f5d080c..2e3e87cc1b 100644 --- a/hw/cpu/arm11mpcore.c +++ b/hw/cpu/arm11mpcore.c @@ -156,7 +156,7 @@ static void mpcore_priv_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = mpcore_priv_realize; - dc->props = mpcore_priv_properties; + device_class_set_props(dc, mpcore_priv_properties); } static const TypeInfo mpcore_priv_info = { diff --git a/hw/cpu/cluster.c b/hw/cpu/cluster.c index 349a883261..e444b7c29d 100644 --- a/hw/cpu/cluster.c +++ b/hw/cpu/cluster.c @@ -78,7 +78,7 @@ static void cpu_cluster_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->props = cpu_cluster_properties; + device_class_set_props(dc, cpu_cluster_properties); dc->realize = cpu_cluster_realize; /* This is not directly for users, CPU children must be attached by code */ diff --git a/hw/cpu/realview_mpcore.c b/hw/cpu/realview_mpcore.c index ae2c9913f6..cc2767c716 100644 --- a/hw/cpu/realview_mpcore.c +++ b/hw/cpu/realview_mpcore.c @@ -125,7 +125,7 @@ static void mpcore_rirq_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = realview_mpcore_realize; - dc->props = mpcore_rirq_properties; + device_class_set_props(dc, mpcore_rirq_properties); } static const TypeInfo mpcore_rirq_info = { -- cgit v1.2.3