mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 12:09:58 +00:00
hw/ssi/pl022: Use DeviceState::realize rather than SysBusDevice::init
Move from the legacy SysBusDevice::init method to using DeviceState::realize. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180820141116.9118-19-peter.maydell@linaro.org Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
275ff67f40
commit
13391a563f
@ -270,26 +270,24 @@ static const VMStateDescription vmstate_pl022 = {
|
||||
}
|
||||
};
|
||||
|
||||
static int pl022_init(SysBusDevice *sbd)
|
||||
static void pl022_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
DeviceState *dev = DEVICE(sbd);
|
||||
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
|
||||
PL022State *s = PL022(dev);
|
||||
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &pl022_ops, s, "pl022", 0x1000);
|
||||
sysbus_init_mmio(sbd, &s->iomem);
|
||||
sysbus_init_irq(sbd, &s->irq);
|
||||
s->ssi = ssi_create_bus(dev, "ssi");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void pl022_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
sdc->init = pl022_init;
|
||||
dc->reset = pl022_reset;
|
||||
dc->vmsd = &vmstate_pl022;
|
||||
dc->realize = pl022_realize;
|
||||
}
|
||||
|
||||
static const TypeInfo pl022_info = {
|
||||
|
Loading…
Reference in New Issue
Block a user