]> Git Repo - qemu.git/commitdiff
hw/timer/sun4v-rtc: Use DeviceState::realize rather than SysBusDevice::init
authorPhilippe Mathieu-Daudé <[email protected]>
Tue, 2 Oct 2018 21:25:12 +0000 (23:25 +0200)
committerEduardo Habkost <[email protected]>
Wed, 24 Oct 2018 09:44:59 +0000 (06:44 -0300)
Move from the legacy SysBusDevice::init method to using DeviceState::realize.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Reviewed-by: Cédric Le Goater <[email protected]>
Message-Id: <20181002212522[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
hw/timer/sun4v-rtc.c

index 13be94f8da6b7165c6d8679441da9d4346b21020..4e7f6a1effe11f557e409b10c342228148edb6e8 100644 (file)
@@ -63,21 +63,21 @@ void sun4v_rtc_init(hwaddr addr)
     sysbus_mmio_map(s, 0, addr);
 }
 
-static int sun4v_rtc_init1(SysBusDevice *dev)
+static void sun4v_rtc_realize(DeviceState *dev, Error **errp)
 {
+    SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
     Sun4vRtc *s = SUN4V_RTC(dev);
 
     memory_region_init_io(&s->iomem, OBJECT(s), &sun4v_rtc_ops, s,
                           "sun4v-rtc", 0x08ULL);
-    sysbus_init_mmio(dev, &s->iomem);
-    return 0;
+    sysbus_init_mmio(sbd, &s->iomem);
 }
 
 static void sun4v_rtc_class_init(ObjectClass *klass, void *data)
 {
-    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
 
-    k->init = sun4v_rtc_init1;
+    dc->realize = sun4v_rtc_realize;
 }
 
 static const TypeInfo sun4v_rtc_info = {
This page took 0.028762 seconds and 4 git commands to generate.