summaryrefslogtreecommitdiffstats
path: root/hw/display/macfb.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2020-02-22 18:12:09 +0100
committerPaolo Bonzini2020-03-17 15:18:48 +0100
commitb9fc4f6e6218439684abbae863bbcb2ecef9201e (patch)
tree1355dd1469024f20a3c895e4484118d1cb806a9c /hw/display/macfb.c
parenthw/core: Let devices own the MemoryRegion they create (diff)
downloadqemu-b9fc4f6e6218439684abbae863bbcb2ecef9201e.tar.gz
qemu-b9fc4f6e6218439684abbae863bbcb2ecef9201e.tar.xz
qemu-b9fc4f6e6218439684abbae863bbcb2ecef9201e.zip
hw/display: Let devices own the MemoryRegion they create
Avoid orphan memory regions being added in the /unattached QOM container. This commit was produced with the Coccinelle script scripts/coccinelle/memory-region-housekeeping.cocci. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'hw/display/macfb.c')
-rw-r--r--hw/display/macfb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/display/macfb.c b/hw/display/macfb.c
index 8bff16d535..b68faff4bb 100644
--- a/hw/display/macfb.c
+++ b/hw/display/macfb.c
@@ -362,8 +362,8 @@ static void macfb_common_realize(DeviceState *dev, MacfbState *s, Error **errp)
return;
}
- memory_region_init_io(&s->mem_ctrl, NULL, &macfb_ctrl_ops, s, "macfb-ctrl",
- 0x1000);
+ memory_region_init_io(&s->mem_ctrl, OBJECT(dev), &macfb_ctrl_ops, s,
+ "macfb-ctrl", 0x1000);
memory_region_init_ram_nomigrate(&s->mem_vram, OBJECT(s), "macfb-vram",
MACFB_VRAM_SIZE, errp);