]> Git Repo - qemu.git/commitdiff
hw/arm: QOM'ify armv7m.c
authorxiaoqiang.zhao <[email protected]>
Mon, 7 Mar 2016 07:05:42 +0000 (15:05 +0800)
committerPeter Maydell <[email protected]>
Thu, 12 May 2016 12:40:48 +0000 (13:40 +0100)
Drop the use of old SysBus init function and use instance_init

Signed-off-by: xiaoqiang zhao <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
hw/arm/armv7m.c

index bb2a22d967f855e016953295fc2ebf106efa25f7..49d30782c883edf68f047c0b3a4c7cc4fbffbf3f 100644 (file)
@@ -132,14 +132,14 @@ typedef struct {
     uint32_t base;
 } BitBandState;
 
-static int bitband_init(SysBusDevice *dev)
+static void bitband_init(Object *obj)
 {
-    BitBandState *s = BITBAND(dev);
+    BitBandState *s = BITBAND(obj);
+    SysBusDevice *dev = SYS_BUS_DEVICE(obj);
 
-    memory_region_init_io(&s->iomem, OBJECT(s), &bitband_ops, &s->base,
+    memory_region_init_io(&s->iomem, obj, &bitband_ops, &s->base,
                           "bitband", 0x02000000);
     sysbus_init_mmio(dev, &s->iomem);
-    return 0;
 }
 
 static void armv7m_bitband_init(void)
@@ -244,9 +244,7 @@ static Property bitband_properties[] = {
 static void bitband_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
-    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
 
-    k->init = bitband_init;
     dc->props = bitband_properties;
 }
 
@@ -254,6 +252,7 @@ static const TypeInfo bitband_info = {
     .name          = TYPE_BITBAND,
     .parent        = TYPE_SYS_BUS_DEVICE,
     .instance_size = sizeof(BitBandState),
+    .instance_init = bitband_init,
     .class_init    = bitband_class_init,
 };
 
This page took 0.027324 seconds and 4 git commands to generate.