diff options
Diffstat (limited to 'hw/pxa2xx_timer.c')
-rw-r--r-- | hw/pxa2xx_timer.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/hw/pxa2xx_timer.c b/hw/pxa2xx_timer.c index cd78d41ab4..90800751b1 100644 --- a/hw/pxa2xx_timer.c +++ b/hw/pxa2xx_timer.c @@ -486,18 +486,20 @@ static Property pxa25x_timer_dev_properties[] = { static void pxa25x_timer_dev_class_init(ObjectClass *klass, void *data) { + DeviceClass *dc = DEVICE_CLASS(klass); SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); k->init = pxa2xx_timer_init; + dc->desc = "PXA25x timer"; + dc->vmsd = &vmstate_pxa2xx_timer_regs; + dc->props = pxa25x_timer_dev_properties; } -static DeviceInfo pxa25x_timer_dev_info = { - .name = "pxa25x-timer", - .desc = "PXA25x timer", - .size = sizeof(PXA2xxTimerInfo), - .vmsd = &vmstate_pxa2xx_timer_regs, - .props = pxa25x_timer_dev_properties, - .class_init = pxa25x_timer_dev_class_init, +static TypeInfo pxa25x_timer_dev_info = { + .name = "pxa25x-timer", + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(PXA2xxTimerInfo), + .class_init = pxa25x_timer_dev_class_init, }; static Property pxa27x_timer_dev_properties[] = { @@ -509,23 +511,25 @@ static Property pxa27x_timer_dev_properties[] = { static void pxa27x_timer_dev_class_init(ObjectClass *klass, void *data) { + DeviceClass *dc = DEVICE_CLASS(klass); SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); k->init = pxa2xx_timer_init; + dc->desc = "PXA27x timer"; + dc->vmsd = &vmstate_pxa2xx_timer_regs; + dc->props = pxa27x_timer_dev_properties; } -static DeviceInfo pxa27x_timer_dev_info = { - .name = "pxa27x-timer", - .desc = "PXA27x timer", - .size = sizeof(PXA2xxTimerInfo), - .vmsd = &vmstate_pxa2xx_timer_regs, - .props = pxa27x_timer_dev_properties, - .class_init = pxa27x_timer_dev_class_init, +static TypeInfo pxa27x_timer_dev_info = { + .name = "pxa27x-timer", + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(PXA2xxTimerInfo), + .class_init = pxa27x_timer_dev_class_init, }; static void pxa2xx_timer_register(void) { - sysbus_register_withprop(&pxa25x_timer_dev_info); - sysbus_register_withprop(&pxa27x_timer_dev_info); + type_register_static(&pxa25x_timer_dev_info); + type_register_static(&pxa27x_timer_dev_info); }; device_init(pxa2xx_timer_register); |