[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 122/136] hw/char: Let devices own the MemoryRegion they create
From: |
Paolo Bonzini |
Subject: |
[PULL 122/136] hw/char: Let devices own the MemoryRegion they create |
Date: |
Tue, 25 Feb 2020 13:07:20 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
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>
Message-Id: <address@hidden>
Supersedes: <address@hidden>
---
hw/char/serial.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/char/serial.c b/hw/char/serial.c
index 9298881..2ab8b69 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -997,7 +997,7 @@ static void serial_io_realize(DeviceState *dev, Error
**errp)
return;
}
- memory_region_init_io(&s->io, NULL, &serial_io_ops, s, "serial", 8);
+ memory_region_init_io(&s->io, OBJECT(dev), &serial_io_ops, s, "serial", 8);
sysbus_init_mmio(SYS_BUS_DEVICE(sio), &s->io);
sysbus_init_irq(SYS_BUS_DEVICE(sio), &s->irq);
}
@@ -1106,8 +1106,9 @@ static void serial_mm_realize(DeviceState *dev, Error
**errp)
return;
}
- memory_region_init_io(&s->io, NULL, &serial_mm_ops[smm->endianness], smm,
- "serial", 8 << smm->regshift);
+ memory_region_init_io(&s->io, OBJECT(dev),
+ &serial_mm_ops[smm->endianness], smm, "serial",
+ 8 << smm->regshift);
sysbus_init_mmio(SYS_BUS_DEVICE(smm), &s->io);
sysbus_init_irq(SYS_BUS_DEVICE(smm), &smm->serial.irq);
}
--
1.8.3.1
- [PULL 110/136] hw/riscv: Use memory_region_init_rom() with read-only regions, (continued)
- [PULL 110/136] hw/riscv: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/02/25
- [PULL 113/136] scripts/cocci: Patch to detect potential use of memory_region_init_rom, Paolo Bonzini, 2020/02/25
- [PULL 112/136] hw/sparc: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/02/25
- [PULL 111/136] hw/sh4: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/02/25
- [PULL 109/136] hw/ppc: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/02/25
- [PULL 114/136] hw/arm/stm32: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/02/25
- [PULL 116/136] hw/i386/pc_sysfw: Simplify using memory_region_init_alias(), Paolo Bonzini, 2020/02/25
- [PULL 117/136] hw/i386/pc_sysfw: Remove unused 'ram_size' argument, Paolo Bonzini, 2020/02/25
- [PULL 118/136] scripts/cocci: Patch to remove unnecessary memory_region_set_readonly(), Paolo Bonzini, 2020/02/25
- [PULL 119/136] hw/arm: Remove unnecessary memory_region_set_readonly() on ROM alias, Paolo Bonzini, 2020/02/25
- [PULL 122/136] hw/char: Let devices own the MemoryRegion they create,
Paolo Bonzini <=
- [PULL 123/136] hw/core: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/02/25
- [PULL 124/136] hw/display: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/02/25
- [PULL 115/136] hw/ppc/ppc405: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/02/25
- [PULL 121/136] hw/arm: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/02/25
- [PULL 127/136] hw/input/milkymist-softusb: Remove unused 'pmem_ptr' field, Paolo Bonzini, 2020/02/25
- [PULL 126/136] hw/riscv: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/02/25
- [PULL 128/136] hw/input/milkymist-softusb: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/02/25
- [PULL 130/136] hw/block/onenand: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/02/25
- [PULL 131/136] memory: batch allocate ioeventfds[] in address_space_update_ioeventfds(), Paolo Bonzini, 2020/02/25
- [PULL 135/136] accel/kvm: Check ioctl(KVM_SET_USER_MEMORY_REGION) return value, Paolo Bonzini, 2020/02/25