mirror of https://github.com/xemu-project/xemu.git
esp.c: switch TypeInfo registration to use DEFINE_TYPES() macro
The use of the DEFINE_TYPES() macro will soon be recommended over the use of calling type_init() directly. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Tested-by: Helge Deller <deller@gmx.de> Tested-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20240112125420.514425-88-mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
This commit is contained in:
parent
442de89a93
commit
499f4089ba
|
@ -1549,14 +1549,6 @@ static void sysbus_esp_class_init(ObjectClass *klass, void *data)
|
||||||
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
|
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo sysbus_esp_info = {
|
|
||||||
.name = TYPE_SYSBUS_ESP,
|
|
||||||
.parent = TYPE_SYS_BUS_DEVICE,
|
|
||||||
.instance_init = sysbus_esp_init,
|
|
||||||
.instance_size = sizeof(SysBusESPState),
|
|
||||||
.class_init = sysbus_esp_class_init,
|
|
||||||
};
|
|
||||||
|
|
||||||
static void esp_finalize(Object *obj)
|
static void esp_finalize(Object *obj)
|
||||||
{
|
{
|
||||||
ESPState *s = ESP(obj);
|
ESPState *s = ESP(obj);
|
||||||
|
@ -1582,19 +1574,22 @@ static void esp_class_init(ObjectClass *klass, void *data)
|
||||||
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
|
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo esp_info = {
|
static const TypeInfo esp_info_types[] = {
|
||||||
.name = TYPE_ESP,
|
{
|
||||||
.parent = TYPE_DEVICE,
|
.name = TYPE_SYSBUS_ESP,
|
||||||
.instance_init = esp_init,
|
.parent = TYPE_SYS_BUS_DEVICE,
|
||||||
.instance_finalize = esp_finalize,
|
.instance_init = sysbus_esp_init,
|
||||||
.instance_size = sizeof(ESPState),
|
.instance_size = sizeof(SysBusESPState),
|
||||||
.class_init = esp_class_init,
|
.class_init = sysbus_esp_class_init,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = TYPE_ESP,
|
||||||
|
.parent = TYPE_DEVICE,
|
||||||
|
.instance_init = esp_init,
|
||||||
|
.instance_finalize = esp_finalize,
|
||||||
|
.instance_size = sizeof(ESPState),
|
||||||
|
.class_init = esp_class_init,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void esp_register_types(void)
|
DEFINE_TYPES(esp_info_types)
|
||||||
{
|
|
||||||
type_register_static(&sysbus_esp_info);
|
|
||||||
type_register_static(&esp_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
type_init(esp_register_types)
|
|
||||||
|
|
Loading…
Reference in New Issue