aboutsummaryrefslogtreecommitdiff
path: root/hw/mips
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-11-20 15:16:29 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2020-01-07 17:24:29 +0400
commitd9259178fe51a0a550fe50561eb0c346ad4518a4 (patch)
treea0c95e1dc926c44a11f2f4b25ad4c594beb836fc /hw/mips
parent4f1733d4c0cdc01f6425683df7dffbc69351a323 (diff)
downloadqemu-d9259178fe51a0a550fe50561eb0c346ad4518a4.zip
qemu-d9259178fe51a0a550fe50561eb0c346ad4518a4.tar.gz
qemu-d9259178fe51a0a550fe50561eb0c346ad4518a4.tar.bz2
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/mips')
-rw-r--r--hw/mips/mips_mipssim.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c
index 2c2c7f2..84c03dd 100644
--- a/hw/mips/mips_mipssim.c
+++ b/hw/mips/mips_mipssim.c
@@ -227,7 +227,8 @@ mips_mipssim_init(MachineState *machine)
qdev_set_legacy_instance_id(dev, 0x3f8, 2);
qdev_init_nofail(dev);
sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, env->irq[4]);
- sysbus_add_io(SYS_BUS_DEVICE(dev), 0x3f8, &SERIAL_IO(dev)->serial.io);
+ sysbus_add_io(SYS_BUS_DEVICE(dev), 0x3f8,
+ sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0));
}
if (nd_table[0].used)