diff mbox series

[04/26] hw/display/apple-gfx: uses DEFINE_TYPES macro

Message ID 20240715210705.32365-5-phil@philjordan.eu (mailing list archive)
State New, archived
Headers show
Series [01/26] hw/vmapple/apple-gfx: Introduce ParavirtualizedGraphics.Framework support | expand

Commit Message

Phil Dennis-Jordan July 15, 2024, 9:06 p.m. UTC
Switches the device definition to the more modern macro variants.

Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu>
---
 hw/display/apple-gfx.m | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)
diff mbox series

Patch

diff --git a/hw/display/apple-gfx.m b/hw/display/apple-gfx.m
index 3b437e2519..87bcdcd98e 100644
--- a/hw/display/apple-gfx.m
+++ b/hw/display/apple-gfx.m
@@ -86,10 +86,8 @@  -(void)mmioWriteAtOffset:(size_t) offset value:(uint32_t)value;
 typedef QTAILQ_HEAD(, AppleGFXTask) AppleGFXTaskList;
 
 typedef struct AppleGFXState {
-    /* Private */
     SysBusDevice parent_obj;
 
-    /* Public */
     qemu_irq irq_gfx;
     qemu_irq irq_iosfc;
     MemoryRegion iomem_gfx;
@@ -562,17 +560,14 @@  static void apple_gfx_class_init(ObjectClass *klass, void *data)
     dc->realize = apple_gfx_realize;
 }
 
-static TypeInfo apple_gfx_info = {
-    .name          = TYPE_APPLE_GFX,
-    .parent        = TYPE_SYS_BUS_DEVICE,
-    .instance_size = sizeof(AppleGFXState),
-    .class_init    = apple_gfx_class_init,
-    .instance_init = apple_gfx_init,
+static TypeInfo apple_gfx_types[] = {
+    {
+        .name          = TYPE_APPLE_GFX,
+        .parent        = TYPE_SYS_BUS_DEVICE,
+        .instance_size = sizeof(AppleGFXState),
+        .class_init    = apple_gfx_class_init,
+        .instance_init = apple_gfx_init,
+    }
 };
 
-static void apple_gfx_register_types(void)
-{
-    type_register_static(&apple_gfx_info);
-}
-
-type_init(apple_gfx_register_types)
+DEFINE_TYPES(apple_gfx_types)