mirror of https://github.com/xemu-project/xemu.git
hw/intc/loongson_ipi: Declare 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. Replace the type_init() / type_register_static() combination. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Acked-by: Song Gao <gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Tested-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Message-Id: <20240718133312.10324-2-philmd@linaro.org>
This commit is contained in:
parent
0c2086bc73
commit
13e8ec6cf3
|
@ -365,16 +365,13 @@ static void loongson_ipi_class_init(ObjectClass *klass, void *data)
|
||||||
dc->vmsd = &vmstate_loongson_ipi;
|
dc->vmsd = &vmstate_loongson_ipi;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo loongson_ipi_info = {
|
static const TypeInfo loongson_ipi_types[] = {
|
||||||
|
{
|
||||||
.name = TYPE_LOONGSON_IPI,
|
.name = TYPE_LOONGSON_IPI,
|
||||||
.parent = TYPE_SYS_BUS_DEVICE,
|
.parent = TYPE_SYS_BUS_DEVICE,
|
||||||
.instance_size = sizeof(LoongsonIPI),
|
.instance_size = sizeof(LoongsonIPI),
|
||||||
.class_init = loongson_ipi_class_init,
|
.class_init = loongson_ipi_class_init,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static void loongson_ipi_register_types(void)
|
DEFINE_TYPES(loongson_ipi_types)
|
||||||
{
|
|
||||||
type_register_static(&loongson_ipi_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
type_init(loongson_ipi_register_types)
|
|
||||||
|
|
Loading…
Reference in New Issue