aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2013-02-04 13:28:01 +0000
committerPeter Maydell <peter.maydell@linaro.org>2013-02-04 13:28:01 +0000
commit5dff5b715b7a7585e2e82183fb8b27800c8440f6 (patch)
tree42a56e3a67e89a272ec6a62dd4e414066481fc11
parent3d07ee23c7746c6a4d3bdd8b4a736b9e906490e3 (diff)
downloadqemu-arm-5dff5b715b7a7585e2e82183fb8b27800c8440f6.tar.gz
hw/arm_sysctl: Convert from qdev init to instance_init
Convert this device from old-style qdev init to an instance_init function. We don't need a realize function yet, though. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/arm_sysctl.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c
index bb56238d55..6d135acdee 100644
--- a/hw/arm_sysctl.c
+++ b/hw/arm_sysctl.c
@@ -525,15 +525,16 @@ static void arm_sysctl_gpio_set(void *opaque, int line, int level)
}
}
-static int arm_sysctl_init(SysBusDevice *dev)
+static void arm_sysctl_init(Object *obj)
{
- arm_sysctl_state *s = FROM_SYSBUS(arm_sysctl_state, dev);
+ DeviceState *dev = DEVICE(obj);
+ SysBusDevice *sd = SYS_BUS_DEVICE(obj);
+ arm_sysctl_state *s = FROM_SYSBUS(arm_sysctl_state, sd);
memory_region_init_io(&s->iomem, &arm_sysctl_ops, s, "arm-sysctl", 0x1000);
- sysbus_init_mmio(dev, &s->iomem);
- qdev_init_gpio_in(&s->busdev.qdev, arm_sysctl_gpio_set, 2);
- qdev_init_gpio_out(&s->busdev.qdev, &s->pl110_mux_ctrl, 1);
- return 0;
+ sysbus_init_mmio(sd, &s->iomem);
+ qdev_init_gpio_in(dev, arm_sysctl_gpio_set, 2);
+ qdev_init_gpio_out(dev, &s->pl110_mux_ctrl, 1);
}
static Property arm_sysctl_properties[] = {
@@ -545,9 +546,7 @@ static Property arm_sysctl_properties[] = {
static void arm_sysctl_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
- SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
- k->init = arm_sysctl_init;
dc->reset = arm_sysctl_reset;
dc->vmsd = &vmstate_arm_sysctl;
dc->props = arm_sysctl_properties;
@@ -557,6 +556,7 @@ static const TypeInfo arm_sysctl_info = {
.name = "realview_sysctl",
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(arm_sysctl_state),
+ .instance_init = arm_sysctl_init,
.class_init = arm_sysctl_class_init,
};