mirror of
https://github.com/qemu/qemu.git
synced 2025-01-23 05:54:02 +08:00
milkymist-pfpu: Convert sysbus init function to realize function
Use DeviceClass rather than SysBusDeviceClass in milkymist_pfpu_class_init(). Cc: michael@walle.cc Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20181130093852.20739-13-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
0f2eabce0d
commit
6b14e87399
@ -497,17 +497,16 @@ static void milkymist_pfpu_reset(DeviceState *d)
|
||||
}
|
||||
}
|
||||
|
||||
static int milkymist_pfpu_init(SysBusDevice *dev)
|
||||
static void milkymist_pfpu_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
MilkymistPFPUState *s = MILKYMIST_PFPU(dev);
|
||||
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
|
||||
|
||||
sysbus_init_irq(dev, &s->irq);
|
||||
sysbus_init_irq(sbd, &s->irq);
|
||||
|
||||
memory_region_init_io(&s->regs_region, OBJECT(dev), &pfpu_mmio_ops, s,
|
||||
"milkymist-pfpu", MICROCODE_END * 4);
|
||||
sysbus_init_mmio(dev, &s->regs_region);
|
||||
|
||||
return 0;
|
||||
sysbus_init_mmio(sbd, &s->regs_region);
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_milkymist_pfpu = {
|
||||
@ -527,9 +526,8 @@ static const VMStateDescription vmstate_milkymist_pfpu = {
|
||||
static void milkymist_pfpu_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = milkymist_pfpu_init;
|
||||
dc->realize = milkymist_pfpu_realize;
|
||||
dc->reset = milkymist_pfpu_reset;
|
||||
dc->vmsd = &vmstate_milkymist_pfpu;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user