diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-11-20 15:16:29 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2020-01-07 17:24:29 +0400 |
commit | d9259178fe51a0a550fe50561eb0c346ad4518a4 (patch) | |
tree | a0c95e1dc926c44a11f2f4b25ad4c594beb836fc /hw/char/serial.c | |
parent | 4f1733d4c0cdc01f6425683df7dffbc69351a323 (diff) |
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>
Diffstat (limited to 'hw/char/serial.c')
-rw-r--r-- | hw/char/serial.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/char/serial.c b/hw/char/serial.c index 7746dfcee8..6c327183c7 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -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); } |