mirror of https://github.com/xemu-project/xemu.git
core/empty_slot: Convert sysbus init function to realize function
Use DeviceClass rather than SysBusDeviceClass in empty_slot_class_init(). Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20181130093852.20739-5-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
ddaa6e049f
commit
4dbf209d42
|
@ -71,21 +71,20 @@ void empty_slot_init(hwaddr addr, uint64_t slot_size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int empty_slot_init1(SysBusDevice *dev)
|
static void empty_slot_realize(DeviceState *dev, Error **errp)
|
||||||
{
|
{
|
||||||
EmptySlot *s = EMPTY_SLOT(dev);
|
EmptySlot *s = EMPTY_SLOT(dev);
|
||||||
|
|
||||||
memory_region_init_io(&s->iomem, OBJECT(s), &empty_slot_ops, s,
|
memory_region_init_io(&s->iomem, OBJECT(s), &empty_slot_ops, s,
|
||||||
"empty-slot", s->size);
|
"empty-slot", s->size);
|
||||||
sysbus_init_mmio(dev, &s->iomem);
|
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void empty_slot_class_init(ObjectClass *klass, void *data)
|
static void empty_slot_class_init(ObjectClass *klass, void *data)
|
||||||
{
|
{
|
||||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||||
|
|
||||||
k->init = empty_slot_init1;
|
dc->realize = empty_slot_realize;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo empty_slot_info = {
|
static const TypeInfo empty_slot_info = {
|
||||||
|
|
Loading…
Reference in New Issue