diff options
| author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-02-07 16:09:19 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2025-02-07 16:09:19 +0000 |
| commit | 3272ddee8caf65f31c131dfca2cf1c133edd745c (patch) | |
| tree | b15dc89130936c2606ef1b6737acc6bfa35cc68e /hw/cpu/realview_mpcore.c | |
| parent | f09613965664e268b00dfc7b4253065e6a0543a9 (diff) | |
| download | focaccia-qemu-3272ddee8caf65f31c131dfca2cf1c133edd745c.tar.gz focaccia-qemu-3272ddee8caf65f31c131dfca2cf1c133edd745c.zip | |
hw/cpu/arm: Declare CPU QOM types using DEFINE_TYPES() macro
When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. In particular because type array declared with such macro are easier to review. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Cédric Le Goater <clg@kaod.org> Message-id: 20250130112615.3219-7-philmd@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/cpu/realview_mpcore.c')
| -rw-r--r-- | hw/cpu/realview_mpcore.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/hw/cpu/realview_mpcore.c b/hw/cpu/realview_mpcore.c index 7480b38d1a..b140888618 100644 --- a/hw/cpu/realview_mpcore.c +++ b/hw/cpu/realview_mpcore.c @@ -114,17 +114,14 @@ static void mpcore_rirq_class_init(ObjectClass *klass, void *data) dc->realize = realview_mpcore_realize; } -static const TypeInfo mpcore_rirq_info = { - .name = TYPE_REALVIEW_MPCORE_RIRQ, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(mpcore_rirq_state), - .instance_init = mpcore_rirq_init, - .class_init = mpcore_rirq_class_init, +static const TypeInfo realview_mpcore_types[] = { + { + .name = TYPE_REALVIEW_MPCORE_RIRQ, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(mpcore_rirq_state), + .instance_init = mpcore_rirq_init, + .class_init = mpcore_rirq_class_init, + }, }; -static void realview_mpcore_register_types(void) -{ - type_register_static(&mpcore_rirq_info); -} - -type_init(realview_mpcore_register_types) +DEFINE_TYPES(realview_mpcore_types) |