diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2020-02-22 18:12:09 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-03-17 15:18:48 +0100 |
commit | b9fc4f6e6218439684abbae863bbcb2ecef9201e (patch) | |
tree | 1355dd1469024f20a3c895e4484118d1cb806a9c /hw/display/g364fb.c | |
parent | de95af9967a777263894165e3ba576581a82da4e (diff) |
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/g364fb.c')
-rw-r--r-- | hw/display/g364fb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c index 55185c95c6..adcba96e34 100644 --- a/hw/display/g364fb.c +++ b/hw/display/g364fb.c @@ -477,7 +477,8 @@ static void g364fb_init(DeviceState *dev, G364State *s) s->con = graphic_console_init(dev, 0, &g364fb_ops, s); - memory_region_init_io(&s->mem_ctrl, NULL, &g364fb_ctrl_ops, s, "ctrl", 0x180000); + memory_region_init_io(&s->mem_ctrl, OBJECT(dev), &g364fb_ctrl_ops, s, + "ctrl", 0x180000); memory_region_init_ram_ptr(&s->mem_vram, NULL, "vram", s->vram_size, s->vram); vmstate_register_ram(&s->mem_vram, dev); |