diff options
author | Andreas Färber <afaerber@suse.de> | 2013-06-09 22:47:35 +0200 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-07-01 01:11:15 +0200 |
commit | 7587ea5bcbdeb08a204b4c1d5afe039d47d613fa (patch) | |
tree | c04ba6af1fd68aa24fdacb9104496b42bd467cee /hw/ppc | |
parent | 43f691e9e248edca7b70680fd87b5be786cc4e01 (diff) |
mpc8544_guts: Turn qdev initfn into instance_init
SysBus can deal with NULL SysBusDeviceClass::init since 4ce5dae.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/ppc')
-rw-r--r-- | hw/ppc/mpc8544_guts.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/hw/ppc/mpc8544_guts.c b/hw/ppc/mpc8544_guts.c index f623b040c9..d41f615522 100644 --- a/hw/ppc/mpc8544_guts.c +++ b/hw/ppc/mpc8544_guts.c @@ -114,29 +114,21 @@ static const MemoryRegionOps mpc8544_guts_ops = { }, }; -static int mpc8544_guts_initfn(SysBusDevice *dev) +static void mpc8544_guts_initfn(Object *obj) { - GutsState *s = MPC8544_GUTS(dev); + SysBusDevice *d = SYS_BUS_DEVICE(obj); + GutsState *s = MPC8544_GUTS(obj); memory_region_init_io(&s->iomem, &mpc8544_guts_ops, s, "mpc8544.guts", MPC8544_GUTS_MMIO_SIZE); - sysbus_init_mmio(dev, &s->iomem); - - return 0; -} - -static void mpc8544_guts_class_init(ObjectClass *klass, void *data) -{ - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - - k->init = mpc8544_guts_initfn; + sysbus_init_mmio(d, &s->iomem); } static const TypeInfo mpc8544_guts_info = { .name = TYPE_MPC8544_GUTS, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(GutsState), - .class_init = mpc8544_guts_class_init, + .instance_init = mpc8544_guts_initfn, }; static void mpc8544_guts_register_types(void) |