aboutsummaryrefslogtreecommitdiff
path: root/hw/acpi
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2020-01-10 19:30:32 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-01-24 20:59:15 +0100
commit4f67d30b5e74e060b8dbe10528829b47345cd6e8 (patch)
tree025b44a1cb86fe029ed4c105b2764a13c21c5bba /hw/acpi
parentb77ade9bb37b2e9813a42008cb21d0c743aa50a1 (diff)
downloadqemu-4f67d30b5e74e060b8dbe10528829b47345cd6e8.zip
qemu-4f67d30b5e74e060b8dbe10528829b47345cd6e8.tar.gz
qemu-4f67d30b5e74e060b8dbe10528829b47345cd6e8.tar.bz2
qdev: set properties with device_class_set_props()
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 <marcandre.lureau@redhat.com> Message-Id: <20200110153039.1379601-20-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/acpi')
-rw-r--r--hw/acpi/generic_event_device.c2
-rw-r--r--hw/acpi/piix4.c2
-rw-r--r--hw/acpi/vmgenid.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c
index 9cee90c..375272e 100644
--- a/hw/acpi/generic_event_device.c
+++ b/hw/acpi/generic_event_device.c
@@ -282,7 +282,7 @@ static void acpi_ged_class_init(ObjectClass *class, void *data)
AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_CLASS(class);
dc->desc = "ACPI Generic Event Device";
- dc->props = acpi_ged_properties;
+ device_class_set_props(dc, acpi_ged_properties);
dc->vmsd = &vmstate_acpi_ged;
hc->plug = acpi_ged_device_plug_cb;
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 93aec2d..6d621c3 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -653,7 +653,7 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data)
dc->reset = piix4_pm_reset;
dc->desc = "PM";
dc->vmsd = &vmstate_acpi;
- dc->props = piix4_pm_properties;
+ device_class_set_props(dc, piix4_pm_properties);
/*
* Reason: part of PIIX4 southbridge, needs to be wired up,
* e.g. by mips_malta_init()
diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
index 6e11b0f..2df7623 100644
--- a/hw/acpi/vmgenid.c
+++ b/hw/acpi/vmgenid.c
@@ -226,7 +226,7 @@ static void vmgenid_device_class_init(ObjectClass *klass, void *data)
dc->vmsd = &vmstate_vmgenid;
dc->realize = vmgenid_realize;
- dc->props = vmgenid_device_properties;
+ device_class_set_props(dc, vmgenid_device_properties);
dc->hotpluggable = false;
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
}