[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 22/55] display/vmware_vga: QOM parent field cleanup
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 22/55] display/vmware_vga: QOM parent field cleanup |
Date: |
Tue, 23 Jul 2013 01:46:03 +0200 |
Replace direct uses of pci_vmsvga_state_s::card with QOM casts and
rename it to parent_obj.
Acked-by: Peter Crosthwaite <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
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 32637e7..3536cde 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)
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, uint32_t
address)
case SVGA_REG_FB_START: {
struct pci_vmsvga_state_s *pci_vmsvga
= container_of(s, struct pci_vmsvga_state_s, chip);
- ret = pci_get_bar_addr(&pci_vmsvga->card, 1);
+ ret = pci_get_bar_addr(PCI_DEVICE(pci_vmsvga), 1);
break;
}
@@ -828,7 +831,7 @@ static uint32_t vmsvga_value_read(void *opaque, uint32_t
address)
case SVGA_REG_MEM_START: {
struct pci_vmsvga_state_s *pci_vmsvga
= container_of(s, struct pci_vmsvga_state_s, chip);
- ret = pci_get_bar_addr(&pci_vmsvga->card, 2);
+ ret = pci_get_bar_addr(PCI_DEVICE(pci_vmsvga), 2);
break;
}
@@ -1176,7 +1179,7 @@ static const VMStateDescription vmstate_vmware_vga = {
.minimum_version_id = 0,
.minimum_version_id_old = 0,
.fields = (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()
@@ -1256,21 +1259,21 @@ static int pci_vmsvga_initfn(PCIDevice *dev)
{
struct pci_vmsvga_state_s *s = VMWARE_SVGA(dev);
- s->card.config[PCI_CACHE_LINE_SIZE] = 0x08; /* Cache line size */
- s->card.config[PCI_LATENCY_TIMER] = 0x40; /* Latency timer */
- s->card.config[PCI_INTERRUPT_LINE] = 0xff; /* End */
+ dev->config[PCI_CACHE_LINE_SIZE] = 0x08;
+ dev->config[PCI_LATENCY_TIMER] = 0x40;
+ dev->config[PCI_INTERRUPT_LINE] = 0xff; /* End */
memory_region_init_io(&s->io_bar, NULL, &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);
vmsvga_init(DEVICE(dev), &s->chip,
pci_address_space(dev), pci_address_space_io(dev));
- 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);
if (!dev->rom_bar) {
--
1.8.1.4
- [Qemu-devel] [PULL 08/55] usb/hcd-xhci: QOM parent field cleanup, (continued)
- [Qemu-devel] [PULL 08/55] usb/hcd-xhci: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 10/55] scsi/lsi53c895a: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 14/55] scsi/esp-pci: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 16/55] ide/ich: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 15/55] ide/ich: QOM Upcast Sweep, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 17/55] acpi/piix4: QOM Upcast Sweep, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 19/55] misc/pci-testdev: QOM Upcast Sweep, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 20/55] misc/pci-testdev: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 18/55] acpi/piix4: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 21/55] display/vmware_vga: QOM casting sweep, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 22/55] display/vmware_vga: QOM parent field cleanup,
Andreas Färber <=
- [Qemu-devel] [PULL 23/55] misc/ivshmem: QOM Upcast Sweep, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 25/55] xen/xen_platform: QOM casting sweep, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 26/55] xen/xen_platform: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 27/55] sysbus: Document SysBusDeviceClass::init and realize semantics, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 24/55] misc/ivshmem: QOM parent field cleanup, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 29/55] ohci: Use QOM realize for OHCI, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 28/55] ohci: QOM'ify some more, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 31/55] i440fx-pcihost: Use QOM realize for i440fx-pcihost, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 33/55] q35: Use QOM realize for q35 host bridge, Andreas Färber, 2013/07/22
- [Qemu-devel] [PULL 30/55] i440fx: Use type-safe cast instead of direct access of parent dev, Andreas Färber, 2013/07/22