@samitouri / QOSamiQemu / commits / 3435f9eed2

hw/acpi/piix4.c: convert ACPI_PM_PROP_PM_IO_BASE to a class prop

ACPI_PM_PROP_PM_IO_BASE can be converted to use object_class_property_add_uint32_ptr(). Remove the now unused piix4_pm_add_properties() function. Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Message-Id: <20260825134320.1039012-17-mark.caveayland@nutanix.com>

Mark Cave-Ayland committed Aug 25, 2026 at 14:41 UTC 3435f9eed289b362097429d031c75bdaa847446b
1 file changed +4 -8
hw/acpi/piix4.c
+4 -8
@@ -405,12 +405,6 @@ static void piix4_pm_machine_ready(Notifier *n, void *opaque)
405 (memory_region_present(io_as, 0x2f8) ? 0x90 : 0);
406 }
407
408 -static void piix4_pm_add_properties(PIIX4PMState *s)
409 -{
410 - object_property_add_uint32_ptr(OBJECT(s), ACPI_PM_PROP_PM_IO_BASE,
411 - &s->io_base, OBJ_PROP_FLAG_READ);
412 -}
413 -
408 static void piix4_pm_add_class_properties(ObjectClass *oc)
409 {
410 static const uint8_t acpi_enable_cmd = ACPI_ENABLE;
@@ -439,6 +433,10 @@ static void piix4_pm_add_class_properties(ObjectClass *oc)
433 ACPI_PM_PROP_SCI_INT,
434 &sci_int,
435 OBJ_PROP_FLAG_READ);
436 + object_class_property_add_uint32_ptr(oc,
437 + ACPI_PM_PROP_PM_IO_BASE,
438 + offsetof(PIIX4PMState, io_base),
439 + OBJ_PROP_FLAG_READ);
440 }
441
442 static void piix4_pm_realize(PCIDevice *dev, Error **errp)
@@ -494,8 +492,6 @@ static void piix4_pm_realize(PCIDevice *dev, Error **errp)
492
493 piix4_acpi_system_hot_add_init(pci_address_space_io(dev),
494 pci_get_bus(dev), s);
497 -
498 - piix4_pm_add_properties(s);
495 }
496
497 static void piix4_pm_init(Object *obj)