[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 18/25] hw/display: Let devices own the MemoryRegion they creat
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 18/25] hw/display: Let devices own the MemoryRegion they create |
Date: |
Mon, 16 Mar 2020 19:49:59 +0100 |
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é <address@hidden>
---
hw/display/g364fb.c | 3 ++-
hw/display/macfb.c | 4 ++--
2 files changed, 4 insertions(+), 3 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);
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);
--
2.21.1
- [PATCH v3 08/25] hw/net: Use memory_region_init_rom() with read-only regions, (continued)
- [PATCH v3 08/25] hw/net: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 09/25] hw/pci-host: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 10/25] hw/ppc: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 11/25] hw/riscv: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 12/25] hw/sh4: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 13/25] hw/sparc: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 14/25] scripts/cocci: Patch to detect potential use of memory_region_init_rom, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 15/25] scripts/cocci: Patch to remove unnecessary memory_region_set_readonly(), Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 16/25] scripts/cocci: Patch to let devices own their MemoryRegions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 17/25] hw/core: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 18/25] hw/display: Let devices own the MemoryRegion they create,
Philippe Mathieu-Daudé <=
- [PATCH v3 19/25] hw/dma: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 20/25] hw/riscv: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 21/25] hw/char: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 22/25] hw/arm/stm32: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 24/25] hw/arm: Remove unnecessary memory_region_set_readonly() on ROM alias, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 23/25] hw/ppc/ppc405: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 25/25] hw/arm: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 06/25] hw/display: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- Re: [PATCH v3 00/25] hw: Sanitize various MemoryRegion calls, Aleksandar Markovic, 2020/03/16