aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/pci-testdev.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-06-30 14:48:56 +0200
committerAndreas Färber <afaerber@suse.de>2013-07-23 00:37:34 +0200
commit6d27a4099e46132768256b686ebf522844a180b6 (patch)
tree69fc20f16d314f88c6cc3009663d4b2dc8e372aa /hw/misc/pci-testdev.c
parent40108d0a6d1e59aa5904298874753fe0cb420a64 (diff)
misc/pci-testdev: QOM parent field cleanup
Replace direct uses of PCITestDevState::dev with QOM casts and rename it to parent_obj. Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/misc/pci-testdev.c')
-rw-r--r--hw/misc/pci-testdev.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
index 3fb15c0da2..d69ff3364d 100644
--- a/hw/misc/pci-testdev.c
+++ b/hw/misc/pci-testdev.c
@@ -76,7 +76,10 @@ enum {
#define IOTEST_ACCESS_WIDTH (sizeof(uint8_t))
typedef struct PCITestDevState {
- PCIDevice dev;
+ /*< private >*/
+ PCIDevice parent_obj;
+ /*< public >*/
+
MemoryRegion mmio;
MemoryRegion portio;
IOTest *tests;
@@ -237,7 +240,7 @@ static int pci_testdev_init(PCIDevice *pci_dev)
char *name;
int r, i;
- pci_conf = d->dev.config;
+ pci_conf = pci_dev->config;
pci_conf[PCI_INTERRUPT_PIN] = 0; /* no interrupt pin */
@@ -245,8 +248,8 @@ static int pci_testdev_init(PCIDevice *pci_dev)
"pci-testdev-mmio", IOTEST_MEMSIZE * 2);
memory_region_init_io(&d->portio, OBJECT(d), &pci_testdev_pio_ops, d,
"pci-testdev-portio", IOTEST_IOSIZE * 2);
- pci_register_bar(&d->dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &d->mmio);
- pci_register_bar(&d->dev, 1, PCI_BASE_ADDRESS_SPACE_IO, &d->portio);
+ pci_register_bar(pci_dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &d->mmio);
+ pci_register_bar(pci_dev, 1, PCI_BASE_ADDRESS_SPACE_IO, &d->portio);
d->current = -1;
d->tests = g_malloc0(IOTEST_MAX * sizeof *d->tests);