diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2020-01-10 19:30:32 +0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-01-24 20:59:15 +0100 |
commit | 4f67d30b5e74e060b8dbe10528829b47345cd6e8 (patch) | |
tree | 025b44a1cb86fe029ed4c105b2764a13c21c5bba /hw/acpi | |
parent | b77ade9bb37b2e9813a42008cb21d0c743aa50a1 (diff) |
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.c | 2 | ||||
-rw-r--r-- | hw/acpi/piix4.c | 2 | ||||
-rw-r--r-- | hw/acpi/vmgenid.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index 9cee90cc70..375272e211 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 93aec2dd2c..6d621c31e7 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 6e11b0fa9b..2df7623d74 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); } |