summary refs log tree commit diff stats
path: root/hw/rtc
diff options
context:
space:
mode:
Diffstat (limited to 'hw/rtc')
-rw-r--r--hw/rtc/m48t59.c2
-rw-r--r--hw/rtc/sun4v-rtc.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/hw/rtc/m48t59.c b/hw/rtc/m48t59.c
index f6acf416ff..b428a06045 100644
--- a/hw/rtc/m48t59.c
+++ b/hw/rtc/m48t59.c
@@ -582,8 +582,8 @@ Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
 
         dev = qdev_new(m48txx_sysbus_info[i].bus_name);
         qdev_prop_set_int32(dev, "base-year", base_year);
-        qdev_realize_and_unref(dev, NULL, &error_fatal);
         s = SYS_BUS_DEVICE(dev);
+        sysbus_realize_and_unref(s, &error_fatal);
         sysbus_connect_irq(s, 0, IRQ);
         if (io_base != 0) {
             memory_region_add_subregion(get_system_io(), io_base,
diff --git a/hw/rtc/sun4v-rtc.c b/hw/rtc/sun4v-rtc.c
index ed1c10832f..52caea8654 100644
--- a/hw/rtc/sun4v-rtc.c
+++ b/hw/rtc/sun4v-rtc.c
@@ -59,7 +59,7 @@ void sun4v_rtc_init(hwaddr addr)
     dev = qdev_new(TYPE_SUN4V_RTC);
     s = SYS_BUS_DEVICE(dev);
 
-    qdev_realize_and_unref(dev, NULL, &error_fatal);
+    sysbus_realize_and_unref(s, &error_fatal);
 
     sysbus_mmio_map(s, 0, addr);
 }