From 828d651c585c1c2a2b8d4e67da36c9f91124855a Mon Sep 17 00:00:00 2001 From: Hao Wu Date: Fri, 8 Jan 2021 11:09:45 -0800 Subject: hw/*: Use type casting for SysBusDevice in NPCM7XX A device shouldn't access its parent object which is QOM internal. Instead it should use type cast for this purporse. This patch fixes this issue for all NPCM7XX Devices. Signed-off-by: Hao Wu Reviewed-by: Peter Maydell Message-id: 20210108190945.949196-7-wuhaotsh@google.com Signed-off-by: Peter Maydell --- hw/misc/npcm7xx_gcr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/misc/npcm7xx_gcr.c') diff --git a/hw/misc/npcm7xx_gcr.c b/hw/misc/npcm7xx_gcr.c index 745f690809..eace9e1967 100644 --- a/hw/misc/npcm7xx_gcr.c +++ b/hw/misc/npcm7xx_gcr.c @@ -220,7 +220,7 @@ static void npcm7xx_gcr_init(Object *obj) memory_region_init_io(&s->iomem, obj, &npcm7xx_gcr_ops, s, TYPE_NPCM7XX_GCR, 4 * KiB); - sysbus_init_mmio(&s->parent, &s->iomem); + sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->iomem); } static const VMStateDescription vmstate_npcm7xx_gcr = { -- cgit 1.4.1