[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 01/10] hw/misc/vmcoreinfo: Declare QOM type using DEFINE_TYPE
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 01/10] hw/misc/vmcoreinfo: Declare QOM type using DEFINE_TYPES macro |
Date: |
Thu, 19 Dec 2024 16:38:48 +0100 |
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/misc/vmcoreinfo.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/hw/misc/vmcoreinfo.c b/hw/misc/vmcoreinfo.c
index 833773ade52..84b211e9117 100644
--- a/hw/misc/vmcoreinfo.c
+++ b/hw/misc/vmcoreinfo.c
@@ -93,16 +93,13 @@ static void vmcoreinfo_device_class_init(ObjectClass
*klass, void *data)
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
}
-static const TypeInfo vmcoreinfo_device_info = {
- .name = VMCOREINFO_DEVICE,
- .parent = TYPE_DEVICE,
- .instance_size = sizeof(VMCoreInfoState),
- .class_init = vmcoreinfo_device_class_init,
+static const TypeInfo vmcoreinfo_types[] = {
+ {
+ .name = VMCOREINFO_DEVICE,
+ .parent = TYPE_DEVICE,
+ .instance_size = sizeof(VMCoreInfoState),
+ .class_init = vmcoreinfo_device_class_init,
+ }
};
-static void vmcoreinfo_register_types(void)
-{
- type_register_static(&vmcoreinfo_device_info);
-}
-
-type_init(vmcoreinfo_register_types)
+DEFINE_TYPES(vmcoreinfo_types)
--
2.47.1
- [RFC PATCH 00/10] hw/misc/vmcoreinfo: Convert from QDev to plain Object, Philippe Mathieu-Daudé, 2024/12/19
- [RFC PATCH 03/10] hw/misc/vmcoreinfo: Un-inline vmcoreinfo_find(), Philippe Mathieu-Daudé, 2024/12/19
- [RFC PATCH 01/10] hw/misc/vmcoreinfo: Declare QOM type using DEFINE_TYPES macro,
Philippe Mathieu-Daudé <=
- [RFC PATCH 04/10] hw/misc/vmcoreinfo: Rename VMCOREINFO_DEVICE -> TYPE_VMCOREINFO_DEVICE, Philippe Mathieu-Daudé, 2024/12/19
- [RFC PATCH 09/10] hw/misc/vmcoreinfo: Deprecate '-device vmcoreinfo', Philippe Mathieu-Daudé, 2024/12/19
- [RFC PATCH 05/10] hw/misc/vmcoreinfo: Convert to three-phase reset interface, Philippe Mathieu-Daudé, 2024/12/19
- [RFC PATCH 07/10] hw/misc/vmcoreinfo: Factor vmcoreinfo_device_realize() out, Philippe Mathieu-Daudé, 2024/12/19
- [RFC PATCH 02/10] hw/misc/vmcoreinfo: Rename opaque pointer as 'opaque', Philippe Mathieu-Daudé, 2024/12/19