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_rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/misc/npcm7xx_rng.c') diff --git a/hw/misc/npcm7xx_rng.c b/hw/misc/npcm7xx_rng.c index f650f34..b01df7c 100644 --- a/hw/misc/npcm7xx_rng.c +++ b/hw/misc/npcm7xx_rng.c @@ -143,7 +143,7 @@ static void npcm7xx_rng_init(Object *obj) memory_region_init_io(&s->iomem, obj, &npcm7xx_rng_ops, s, "regs", NPCM7XX_RNG_REGS_SIZE); - sysbus_init_mmio(&s->parent, &s->iomem); + sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->iomem); } static const VMStateDescription vmstate_npcm7xx_rng = { -- cgit v1.1