mips: use sysbus_mmio_get_region() instead of internal fields
commitd9259178fe51a0a550fe50561eb0c346ad4518a4
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 20 Nov 2019 11:16:29 +0000 (20 15:16 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 7 Jan 2020 13:24:29 +0000 (7 17:24 +0400)
treea0c95e1dc926c44a11f2f4b25ad4c594beb836fc
parent4f1733d4c0cdc01f6425683df7dffbc69351a323
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>
hw/char/serial.c
hw/mips/mips_mipssim.c