qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Phil Dennis-Jordan
Subject: [PATCH 04/26] hw/display/apple-gfx: uses DEFINE_TYPES macro
Date: Mon, 15 Jul 2024 23:06:43 +0200

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 --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)
-- 
2.39.3 (Apple Git-146)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]