summaryrefslogtreecommitdiffstats
path: root/hw/arm/nrf51_soc.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2020-02-24 18:32:23 +0100
committerPaolo Bonzini2020-03-17 15:18:50 +0100
commit32b9523ad5b44dea87792d5d8f71a87e8cc5803b (patch)
treecbb0e660e9f536833bc7c7c24d6b37d51477bcab /hw/arm/nrf51_soc.c
parenthw/arm: Remove unnecessary memory_region_set_readonly() on ROM alias (diff)
downloadqemu-32b9523ad5b44dea87792d5d8f71a87e8cc5803b.tar.gz
qemu-32b9523ad5b44dea87792d5d8f71a87e8cc5803b.tar.xz
qemu-32b9523ad5b44dea87792d5d8f71a87e8cc5803b.zip
hw/arm: 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/arm/nrf51_soc.c')
-rw-r--r--hw/arm/nrf51_soc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c
index 4817a76ae0..57eff63f0d 100644
--- a/hw/arm/nrf51_soc.c
+++ b/hw/arm/nrf51_soc.c
@@ -165,7 +165,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
}
/* STUB Peripherals */
- memory_region_init_io(&s->clock, NULL, &clock_ops, NULL,
+ memory_region_init_io(&s->clock, OBJECT(dev_soc), &clock_ops, NULL,
"nrf51_soc.clock", 0x1000);
memory_region_add_subregion_overlap(&s->container,
NRF51_IOMEM_BASE, &s->clock, -1);