diff options
Diffstat (limited to 'hw/dec_pci.c')
-rw-r--r-- | hw/dec_pci.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/hw/dec_pci.c b/hw/dec_pci.c index 7c3f50e678..f0ecaff07d 100644 --- a/hw/dec_pci.c +++ b/hw/dec_pci.c @@ -84,7 +84,7 @@ PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn) return pci_bridge_get_sec_bus(br); } -static int pci_dec_21154_init_device(SysBusDevice *dev) +static int pci_dec_21154_device_init(SysBusDevice *dev) { DECState *s; @@ -123,11 +123,22 @@ static DeviceInfo dec_21154_pci_host_info = { .class_init = dec_21154_pci_host_class_init, }; -static void dec_register_devices(void) +static void pci_dec_21154_device_class_init(ObjectClass *klass, void *data) { - sysbus_register_dev("dec-21154", sizeof(DECState), - pci_dec_21154_init_device); + SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass); + + sdc->init = pci_dec_21154_device_init; +} + +static DeviceInfo pci_dec_21154_device_info = { + .name = "dec-21154", + .size = sizeof(DECState), + .class_init = pci_dec_21154_device_class_init, +}; +static void dec_register_devices(void) +{ + sysbus_qdev_register(&pci_dec_21154_device_info); pci_qdev_register(&dec_21154_pci_host_info); pci_qdev_register(&dec_21154_pci_bridge_info); } |