summaryrefslogtreecommitdiffstats
path: root/hw/dma/i8257.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2020-02-22 18:12:37 +0100
committerPaolo Bonzini2020-03-17 15:18:49 +0100
commita8457764877c7d4070e5369e98d27876470ac6d0 (patch)
tree317c2b908a538836defe7a36e9d2c2ef7b54f930 /hw/dma/i8257.c
parenthw/display: Let devices own the MemoryRegion they create (diff)
downloadqemu-a8457764877c7d4070e5369e98d27876470ac6d0.tar.gz
qemu-a8457764877c7d4070e5369e98d27876470ac6d0.tar.xz
qemu-a8457764877c7d4070e5369e98d27876470ac6d0.zip
hw/dma: 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/dma/i8257.c')
-rw-r--r--hw/dma/i8257.c2
1 files changed, 1 insertions, 1 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);