From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtHGx-0001yz-51 for qemu-devel@nongnu.org; Sun, 30 Jun 2013 09:02:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtHGw-0005ZL-58 for qemu-devel@nongnu.org; Sun, 30 Jun 2013 09:02:31 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49603 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtHGv-0005ZA-SV for qemu-devel@nongnu.org; Sun, 30 Jun 2013 09:02:30 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 30 Jun 2013 15:02:23 +0200 Message-Id: <1372597343-26384-1-git-send-email-afaerber@suse.de> In-Reply-To: <566136fd00e29c95756d80eec288e3265b0da486.1372055322.git.peter.crosthwaite@xilinx.com> References: <566136fd00e29c95756d80eec288e3265b0da486.1372055322.git.peter.crosthwaite@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH qom-next] display/vmware_vga: QOM parent field cleanup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Peter Crosthwaite , =?UTF-8?q?Andreas=20F=C3=A4rber?= , "Michael S. Tsirkin" Rename to parent_obj and fix any fallout. Signed-off-by: Andreas F=C3=A4rber --- hw/display/vmware_vga.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index fcc8944..8624be9 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -87,7 +87,10 @@ struct vmsvga_state_s { OBJECT_CHECK(struct pci_vmsvga_state_s, (obj), TYPE_VMWARE_SVGA) =20 struct pci_vmsvga_state_s { - PCIDevice card; + /*< private >*/ + PCIDevice parent_obj; + /*< public >*/ + struct vmsvga_state_s chip; MemoryRegion io_bar; }; @@ -792,7 +795,7 @@ static uint32_t vmsvga_value_read(void *opaque, uint3= 2_t address) case SVGA_REG_FB_START: { struct pci_vmsvga_state_s *pci_vmsvga =3D container_of(s, struct pci_vmsvga_state_s, chip); - ret =3D pci_get_bar_addr(&pci_vmsvga->card, 1); + ret =3D pci_get_bar_addr(PCI_DEVICE(pci_vmsvga), 1); break; } =20 @@ -828,7 +831,7 @@ static uint32_t vmsvga_value_read(void *opaque, uint3= 2_t address) case SVGA_REG_MEM_START: { struct pci_vmsvga_state_s *pci_vmsvga =3D container_of(s, struct pci_vmsvga_state_s, chip); - ret =3D pci_get_bar_addr(&pci_vmsvga->card, 2); + ret =3D pci_get_bar_addr(PCI_DEVICE(pci_vmsvga), 2); break; } =20 @@ -1176,7 +1179,7 @@ static const VMStateDescription vmstate_vmware_vga = =3D { .minimum_version_id =3D 0, .minimum_version_id_old =3D 0, .fields =3D (VMStateField[]) { - VMSTATE_PCI_DEVICE(card, struct pci_vmsvga_state_s), + VMSTATE_PCI_DEVICE(parent_obj, struct pci_vmsvga_state_s), VMSTATE_STRUCT(chip, struct pci_vmsvga_state_s, 0, vmstate_vmware_vga_internal, struct vmsvga_state_= s), VMSTATE_END_OF_LIST() @@ -1252,21 +1255,21 @@ static int pci_vmsvga_initfn(PCIDevice *dev) { struct pci_vmsvga_state_s *s =3D VMWARE_SVGA(dev); =20 - s->card.config[PCI_CACHE_LINE_SIZE] =3D 0x08; /* Cache line = size */ - s->card.config[PCI_LATENCY_TIMER] =3D 0x40; /* Latency tim= er */ - s->card.config[PCI_INTERRUPT_LINE] =3D 0xff; /* End */ + dev->config[PCI_CACHE_LINE_SIZE] =3D 0x08; + dev->config[PCI_LATENCY_TIMER] =3D 0x40; + dev->config[PCI_INTERRUPT_LINE] =3D 0xff; /* End */ =20 memory_region_init_io(&s->io_bar, &vmsvga_io_ops, &s->chip, "vmsvga-io", 0x10); memory_region_set_flush_coalesced(&s->io_bar); - pci_register_bar(&s->card, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io_bar)= ; + pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io_bar); =20 vmsvga_init(DEVICE(dev), &s->chip, pci_address_space(dev), pci_address_space_io(dev)); =20 - pci_register_bar(&s->card, 1, PCI_BASE_ADDRESS_MEM_PREFETCH, + pci_register_bar(dev, 1, PCI_BASE_ADDRESS_MEM_PREFETCH, &s->chip.vga.vram); - pci_register_bar(&s->card, 2, PCI_BASE_ADDRESS_MEM_PREFETCH, + pci_register_bar(dev, 2, PCI_BASE_ADDRESS_MEM_PREFETCH, &s->chip.fifo_ram); =20 if (!dev->rom_bar) { --=20 1.8.1.4