aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2024-01-12 12:54:19 +0000
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2024-02-13 19:37:28 +0000
commit499f4089ba238edc9aa84c1c8c97258844af3635 (patch)
tree052514f895015a686c8971e3cb0035816d957932 /hw/scsi
parent442de89a9378cd663e71408af0542c013d90a229 (diff)
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>
Diffstat (limited to 'hw/scsi')
-rw-r--r--hw/scsi/esp.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 04615d8b5f..b8762d5ee0 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -1549,14 +1549,6 @@ static void sysbus_esp_class_init(ObjectClass *klass, void *data)
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)
{
ESPState *s = ESP(obj);
@@ -1582,19 +1574,22 @@ static void esp_class_init(ObjectClass *klass, void *data)
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
}
-static const TypeInfo esp_info = {
- .name = TYPE_ESP,
- .parent = TYPE_DEVICE,
- .instance_init = esp_init,
- .instance_finalize = esp_finalize,
- .instance_size = sizeof(ESPState),
- .class_init = esp_class_init,
+static const TypeInfo esp_info_types[] = {
+ {
+ .name = TYPE_SYSBUS_ESP,
+ .parent = TYPE_SYS_BUS_DEVICE,
+ .instance_init = sysbus_esp_init,
+ .instance_size = sizeof(SysBusESPState),
+ .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)
-{
- type_register_static(&sysbus_esp_info);
- type_register_static(&esp_info);
-}
-
-type_init(esp_register_types)
+DEFINE_TYPES(esp_info_types)