mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
mips: use sysbus_mmio_get_region() instead of internal fields
Register the memory region with sysbus_init_mmio() and look it up with sysbus_mmio_get_region() to avoid accessing internal device fields. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This commit is contained in:
parent
4f1733d4c0
commit
d9259178fe
2 changed files with 3 additions and 1 deletions
|
@ -998,6 +998,7 @@ static void serial_io_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
memory_region_init_io(&s->io, NULL, &serial_io_ops, s, "serial", 8);
|
||||
sysbus_init_mmio(SYS_BUS_DEVICE(sio), &s->io);
|
||||
sysbus_init_irq(SYS_BUS_DEVICE(sio), &s->irq);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue