hw/rtc/mc146818rtc: convert date from object prop to class prop
This is to allow it to be the target of a class alias property. Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Message-ID: <20260703090814.2993188-6-mark.caveayland@nutanix.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Mark Cave-Ayland committed
Jul 3, 2026 at 10:07 UTC
a02e7fa9e6997a514e41dd47a914dbddfe5aa1bf
1 file changed
+2
-2
hw/rtc/mc146818rtc.c
+2
-2
@@ -920,8 +920,6 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
920
memory_region_add_subregion(&s->io, 0, &s->coalesced_io);
921
memory_region_add_coalescing(&s->coalesced_io, 0, 1);
922
923
- object_property_add_tm(OBJECT(s), "date", rtc_get_date);
924
-
923
qdev_init_gpio_out(dev, &s->irq, 1);
924
}
925
@@ -1020,6 +1018,8 @@ static void rtc_class_initfn(ObjectClass *klass, const void *data)
1018
adevc->build_dev_aml = rtc_build_aml;
1019
device_class_set_props(dc, mc146818rtc_properties);
1020
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
1021
+
1022
+ object_class_property_add_tm(klass, "date", rtc_get_date);
1023
}
1024
1025
static const TypeInfo mc146818rtc_info = {