mirror of https://github.com/xemu-project/xemu.git
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>
This commit is contained in:
parent
40108d0a6d
commit
6d27a4099e
|
@ -76,7 +76,10 @@ enum {
|
||||||
#define IOTEST_ACCESS_WIDTH (sizeof(uint8_t))
|
#define IOTEST_ACCESS_WIDTH (sizeof(uint8_t))
|
||||||
|
|
||||||
typedef struct PCITestDevState {
|
typedef struct PCITestDevState {
|
||||||
PCIDevice dev;
|
/*< private >*/
|
||||||
|
PCIDevice parent_obj;
|
||||||
|
/*< public >*/
|
||||||
|
|
||||||
MemoryRegion mmio;
|
MemoryRegion mmio;
|
||||||
MemoryRegion portio;
|
MemoryRegion portio;
|
||||||
IOTest *tests;
|
IOTest *tests;
|
||||||
|
@ -237,7 +240,7 @@ static int pci_testdev_init(PCIDevice *pci_dev)
|
||||||
char *name;
|
char *name;
|
||||||
int r, i;
|
int r, i;
|
||||||
|
|
||||||
pci_conf = d->dev.config;
|
pci_conf = pci_dev->config;
|
||||||
|
|
||||||
pci_conf[PCI_INTERRUPT_PIN] = 0; /* no interrupt pin */
|
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);
|
"pci-testdev-mmio", IOTEST_MEMSIZE * 2);
|
||||||
memory_region_init_io(&d->portio, OBJECT(d), &pci_testdev_pio_ops, d,
|
memory_region_init_io(&d->portio, OBJECT(d), &pci_testdev_pio_ops, d,
|
||||||
"pci-testdev-portio", IOTEST_IOSIZE * 2);
|
"pci-testdev-portio", IOTEST_IOSIZE * 2);
|
||||||
pci_register_bar(&d->dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &d->mmio);
|
pci_register_bar(pci_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, 1, PCI_BASE_ADDRESS_SPACE_IO, &d->portio);
|
||||||
|
|
||||||
d->current = -1;
|
d->current = -1;
|
||||||
d->tests = g_malloc0(IOTEST_MAX * sizeof *d->tests);
|
d->tests = g_malloc0(IOTEST_MAX * sizeof *d->tests);
|
||||||
|
|
Loading…
Reference in New Issue