From 4e5dcc774a4003e313b6eec823067b3980b0bc91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 30 Jun 2013 14:07:49 +0200 Subject: scsi/esp-pci: QOM parent field cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace direct uses of PCIESPState::dev with QOM casts and rename it to parent_obj. Acked-by: Peter Crosthwaite Signed-off-by: Andreas Färber --- hw/scsi/esp-pci.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'hw/scsi') diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c index ab1fa85f08..6cdfd5338e 100644 --- a/hw/scsi/esp-pci.c +++ b/hw/scsi/esp-pci.c @@ -60,7 +60,10 @@ #define SBAC_STATUS 0x1000 typedef struct PCIESPState { - PCIDevice dev; + /*< private >*/ + PCIDevice parent_obj; + /*< public >*/ + MemoryRegion io; uint32_t dma_regs[8]; uint32_t sbac; @@ -260,7 +263,7 @@ static void esp_pci_dma_memory_rw(PCIESPState *pci, uint8_t *buf, int len, len = pci->dma_regs[DMA_WBC]; } - pci_dma_rw(&pci->dev, addr, buf, len, dir); + pci_dma_rw(PCI_DEVICE(pci), addr, buf, len, dir); /* update status registers */ pci->dma_regs[DMA_WBC] -= len; @@ -309,7 +312,7 @@ static const VMStateDescription vmstate_esp_pci_scsi = { .minimum_version_id = 0, .minimum_version_id_old = 0, .fields = (VMStateField[]) { - VMSTATE_PCI_DEVICE(dev, PCIESPState), + VMSTATE_PCI_DEVICE(parent_obj, PCIESPState), VMSTATE_BUFFER_UNSAFE(dma_regs, PCIESPState, 0, 8 * sizeof(uint32_t)), VMSTATE_STRUCT(esp, PCIESPState, 0, vmstate_esp, ESPState), VMSTATE_END_OF_LIST() @@ -344,7 +347,7 @@ static int esp_pci_scsi_init(PCIDevice *dev) ESPState *s = &pci->esp; uint8_t *pci_conf; - pci_conf = pci->dev.config; + pci_conf = dev->config; /* Interrupt pin A */ pci_conf[PCI_INTERRUPT_PIN] = 0x01; @@ -356,8 +359,8 @@ static int esp_pci_scsi_init(PCIDevice *dev) memory_region_init_io(&pci->io, OBJECT(pci), &esp_pci_io_ops, pci, "esp-io", 0x80); - pci_register_bar(&pci->dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &pci->io); - s->irq = pci->dev.irq[0]; + pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &pci->io); + s->irq = dev->irq[0]; scsi_bus_new(&s->bus, d, &esp_pci_scsi_info, NULL); if (!d->hotplugged) { -- cgit v1.2.3