summary refs log tree commit diff stats
path: root/hw/opencores_eth.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/opencores_eth.c')
-rw-r--r--hw/opencores_eth.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/hw/opencores_eth.c b/hw/opencores_eth.c
index 1f45506100..09f2757df3 100644
--- a/hw/opencores_eth.c
+++ b/hw/opencores_eth.c
@@ -734,23 +734,25 @@ static Property open_eth_properties[] = {
 
 static void open_eth_class_init(ObjectClass *klass, void *data)
 {
+    DeviceClass *dc = DEVICE_CLASS(klass);
     SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
 
     k->init = sysbus_open_eth_init;
+    dc->desc = "Opencores 10/100 Mbit Ethernet";
+    dc->reset = qdev_open_eth_reset;
+    dc->props = open_eth_properties;
 }
 
-static DeviceInfo open_eth_info = {
-    .name = "open_eth",
-    .desc = "Opencores 10/100 Mbit Ethernet",
-    .size = sizeof(OpenEthState),
-    .reset = qdev_open_eth_reset,
-    .props = open_eth_properties,
-    .class_init = open_eth_class_init,
+static TypeInfo open_eth_info = {
+    .name          = "open_eth",
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(OpenEthState),
+    .class_init    = open_eth_class_init,
 };
 
 static void open_eth_register_devices(void)
 {
-    sysbus_register_withprop(&open_eth_info);
+    type_register_static(&open_eth_info);
 }
 
 device_init(open_eth_register_devices)