From 64a013e18bbd02c26a7ca2b2c4c1a14d77058749 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 21 Oct 2025 13:02:36 +0400 Subject: [PATCH] hw/pcspk: make 'pit' a class property MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This should be functionally equivalent. (for some reason, the device property was convert to an object instance property in commit 873b4d3f0571) Signed-off-by: Marc-André Lureau Message-ID: <20251021090317.425409-6-marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé --- hw/audio/pcspk.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index 9cf78ff55f..7b716c08ef 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -182,11 +182,6 @@ static void pcspk_initfn(Object *obj) PCSpkState *s = PC_SPEAKER(obj); memory_region_init_io(&s->ioport, OBJECT(s), &pcspk_io_ops, s, "pcspk", 1); - - object_property_add_link(obj, "pit", TYPE_PIT_COMMON, - (Object **)&s->pit, - qdev_prop_allow_set_link_before_realize, - 0); } static void pcspk_realizefn(DeviceState *dev, Error **errp) @@ -224,6 +219,7 @@ static const Property pcspk_properties[] = { DEFINE_AUDIO_PROPERTIES(PCSpkState, card), DEFINE_PROP_UINT32("iobase", PCSpkState, iobase, 0x61), DEFINE_PROP_BOOL("migrate", PCSpkState, migrate, true), + DEFINE_PROP_LINK("pit", PCSpkState, pit, TYPE_PIT_COMMON, PITCommonState *), }; static void pcspk_class_initfn(ObjectClass *klass, const void *data) -- 2.47.3