Patchwork [v2,29/30] pci-host/*: substitute ->qdev casts with DEVICE()

login
register
mail settings
Submitter Peter Crosthwaite
Date June 24, 2013, 7:11 a.m.
Message ID <28e4b72ef973331283eba37203c250ff40dddb0e.1372055322.git.peter.crosthwaite@xilinx.com>
Download mbox | patch
Permalink /patch/253687/
State New
Headers show

Comments

Peter Crosthwaite - June 24, 2013, 7:11 a.m.
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---

 hw/pci-bridge/dec.c | 2 +-
 hw/pci-host/apb.c   | 4 ++--
 hw/pci-host/q35.c   | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

Patch

diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c
index cff458b..1e5611d 100644
--- a/hw/pci-bridge/dec.c
+++ b/hw/pci-bridge/dec.c
@@ -88,7 +88,7 @@  PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn)
                                    "dec-21154-p2p-bridge");
     br = DO_UPCAST(PCIBridge, dev, dev);
     pci_bridge_map_irq(br, "DEC 21154 PCI-PCI bridge", dec_map_irq);
-    qdev_init_nofail(&dev->qdev);
+    qdev_init_nofail(DEVICE(dev));
     return pci_bridge_get_sec_bus(br);
 }
 
diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c
index e099655..f3987ff 100644
--- a/hw/pci-host/apb.c
+++ b/hw/pci-host/apb.c
@@ -467,7 +467,7 @@  PCIBus *pci_apb_init(hwaddr special_base,
     br = DO_UPCAST(PCIBridge, dev, pci_dev);
     pci_bridge_map_irq(br, "Advanced PCI Bus secondary bridge 1",
                        pci_apb_map_irq);
-    qdev_init_nofail(&pci_dev->qdev);
+    qdev_init_nofail(DEVICE(dev));
     *bus2 = pci_bridge_get_sec_bus(br);
 
     pci_dev = pci_create_multifunction(d->bus, PCI_DEVFN(1, 1), true,
@@ -475,7 +475,7 @@  PCIBus *pci_apb_init(hwaddr special_base,
     br = DO_UPCAST(PCIBridge, dev, pci_dev);
     pci_bridge_map_irq(br, "Advanced PCI Bus secondary bridge 2",
                        pci_apb_map_irq);
-    qdev_init_nofail(&pci_dev->qdev);
+    qdev_init_nofail(DEVICE(pci_dev));
     *bus3 = pci_bridge_get_sec_bus(br);
 
     return d->bus;
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index 24df6b5..d04471c 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -104,8 +104,8 @@  static const TypeInfo q35_host_info = {
 /* PCIe MMCFG */
 static void mch_update_pciexbar(MCHPCIState *mch)
 {
-    PCIDevice *pci_dev = &mch->d;
-    BusState *bus = qdev_get_parent_bus(&pci_dev->qdev);
+    PCIDevice *pci_dev = PCI_DEVICE(mch);
+    BusState *bus = qdev_get_parent_bus(DEVICE(pci_dev));
     DeviceState *qdev = bus->parent;
     Q35PCIHost *s = Q35_HOST_DEVICE(qdev);