[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RESEND v2 27/32] hw/dma: Let devices own the MemoryRegion they cr
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH RESEND v2 27/32] hw/dma: Let devices own the MemoryRegion they create |
Date: |
Mon, 24 Feb 2020 21:55:28 +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/dma/i8257.c | 2 +-
hw/dma/rc4030.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c
index bad8debae4..ef15c06d77 100644
--- a/hw/dma/i8257.c
+++ b/hw/dma/i8257.c
@@ -553,7 +553,7 @@ static void i8257_realize(DeviceState *dev, Error **errp)
I8257State *d = I8257(dev);
int i;
- memory_region_init_io(&d->channel_io, NULL, &channel_io_ops, d,
+ memory_region_init_io(&d->channel_io, OBJECT(dev), &channel_io_ops, d,
"dma-chan", 8 << d->dshift);
memory_region_add_subregion(isa_address_space_io(isa),
d->base, &d->channel_io);
diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c
index c4cf8236f4..f62eb3d2a3 100644
--- a/hw/dma/rc4030.c
+++ b/hw/dma/rc4030.c
@@ -679,9 +679,9 @@ static void rc4030_realize(DeviceState *dev, Error **errp)
s->periodic_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
rc4030_periodic_timer, s);
- memory_region_init_io(&s->iomem_chipset, NULL, &rc4030_ops, s,
+ memory_region_init_io(&s->iomem_chipset, o, &rc4030_ops, s,
"rc4030.chipset", 0x300);
- memory_region_init_io(&s->iomem_jazzio, NULL, &jazzio_ops, s,
+ memory_region_init_io(&s->iomem_jazzio, o, &jazzio_ops, s,
"rc4030.jazzio", 0x00001000);
memory_region_init_iommu(&s->dma_mr, sizeof(s->dma_mr),
--
2.21.1
- Re: [PATCH RESEND v2 18/32] hw/i386/pc_sysfw: Simplify using memory_region_init_alias(), (continued)
- [PATCH RESEND v2 19/32] hw/i386/pc_sysfw: Remove unused 'ram_size' argument, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 20/32] scripts/cocci: Patch to remove unnecessary memory_region_set_readonly(), Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 21/32] hw/arm: Remove unnecessary memory_region_set_readonly() on ROM alias, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 22/32] scripts/cocci: Patch to let devices own their MemoryRegions, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 23/32] hw/arm: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 24/32] hw/char: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 25/32] hw/core: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 26/32] hw/display: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 27/32] hw/dma: Let devices own the MemoryRegion they create,
Philippe Mathieu-Daudé <=
- [PATCH RESEND v2 28/32] hw/riscv: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 29/32] hw/input/milkymist-softusb: Remove unused 'pmem_ptr' field, Philippe Mathieu-Daudé, 2020/02/24
- [RFC PATCH RESEND v2 30/32] hw/input/milkymist-softusb: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [RFC PATCH RESEND v2 31/32] hw/net/milkymist-minimac2: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [RFC PATCH RESEND v2 32/32] hw/block/onenand: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24