Patchwork [35/66] vga: pass owner to vga_init_io

login
register
mail settings
Submitter Paolo Bonzini
Date July 4, 2013, 3:13 p.m.
Message ID <1372950842-32422-36-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/256923/
State New
Headers show

Comments

Paolo Bonzini - July 4, 2013, 3:13 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/display/vga-isa.c | 2 +-
 hw/display/vga.c     | 6 +++---
 hw/display/vga_int.h | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

Patch

diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c
index 5f253a9..8d560ec 100644
--- a/hw/display/vga-isa.c
+++ b/hw/display/vga-isa.c
@@ -58,7 +58,7 @@  static void vga_isa_realizefn(DeviceState *dev, Error **errp)
 
     vga_common_init(s, OBJECT(dev));
     s->legacy_address_space = isa_address_space(isadev);
-    vga_io_memory = vga_init_io(s, &vga_ports, &vbe_ports);
+    vga_io_memory = vga_init_io(s, OBJECT(dev), &vga_ports, &vbe_ports);
     isa_register_portio_list(isadev, 0x3b0, vga_ports, s, "vga");
     if (vbe_ports) {
         isa_register_portio_list(isadev, 0x1ce, vbe_ports, s, "vbe");
diff --git a/hw/display/vga.c b/hw/display/vga.c
index ce3ca7e..7a6e935 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -2333,7 +2333,7 @@  static const MemoryRegionPortio vbe_portio_list[] = {
 };
 
 /* Used by both ISA and PCI */
-MemoryRegion *vga_init_io(VGACommonState *s,
+MemoryRegion *vga_init_io(VGACommonState *s, Object *obj,
                           const MemoryRegionPortio **vga_ports,
                           const MemoryRegionPortio **vbe_ports)
 {
@@ -2343,7 +2343,7 @@  MemoryRegion *vga_init_io(VGACommonState *s,
     *vbe_ports = vbe_portio_list;
 
     vga_mem = g_malloc(sizeof(*vga_mem));
-    memory_region_init_io(vga_mem, NULL, &vga_mem_ops, s,
+    memory_region_init_io(vga_mem, obj, &vga_mem_ops, s,
                           "vga-lowmem", 0x20000);
     memory_region_set_flush_coalesced(vga_mem);
 
@@ -2364,7 +2364,7 @@  void vga_init(VGACommonState *s, Object *obj, MemoryRegion *address_space,
 
     s->legacy_address_space = address_space;
 
-    vga_io_memory = vga_init_io(s, &vga_ports, &vbe_ports);
+    vga_io_memory = vga_init_io(s, obj, &vga_ports, &vbe_ports);
     memory_region_add_subregion_overlap(address_space,
                                         isa_mem_base + 0x000a0000,
                                         vga_io_memory,
diff --git a/hw/display/vga_int.h b/hw/display/vga_int.h
index 5121a35..e641890 100644
--- a/hw/display/vga_int.h
+++ b/hw/display/vga_int.h
@@ -180,7 +180,7 @@  static inline int c6_to_8(int v)
 void vga_common_init(VGACommonState *s, Object *obj);
 void vga_init(VGACommonState *s, Object *obj, MemoryRegion *address_space,
               MemoryRegion *address_space_io, bool init_vga_ports);
-MemoryRegion *vga_init_io(VGACommonState *s,
+MemoryRegion *vga_init_io(VGACommonState *s, Object *obj,
                           const MemoryRegionPortio **vga_ports,
                           const MemoryRegionPortio **vbe_ports);
 void vga_common_reset(VGACommonState *s);