Patchwork [v2,19/30] pci/pci_bridge: substitute ->qdev casts with DEVICE()

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

Comments

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

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

 hw/pci/pci_bridge.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Patch

diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c
index 24be6c5..f6657e8 100644
--- a/hw/pci/pci_bridge.c
+++ b/hw/pci/pci_bridge.c
@@ -330,6 +330,7 @@  void pci_bridge_reset(DeviceState *qdev)
 /* default qdev initialization function for PCI-to-PCI bridge */
 int pci_bridge_initfn(PCIDevice *dev, const char *typename)
 {
+    DeviceState *d = DEVICE(dev);
     PCIBus *parent = dev->bus;
     PCIBridge *br = DO_UPCAST(PCIBridge, dev, dev);
     PCIBus *sec_bus = &br->sec_bus;
@@ -359,11 +360,11 @@  int pci_bridge_initfn(PCIDevice *dev, const char *typename)
      * Since PCI Bridge devices have a single bus each, we don't need the index:
      * let users address the bus using the device name.
      */
-    if (!br->bus_name && dev->qdev.id && *dev->qdev.id) {
-	    br->bus_name = dev->qdev.id;
+    if (!br->bus_name && d->id && *d->id) {
+        br->bus_name = d->id;
     }
 
-    qbus_create_inplace(&sec_bus->qbus, typename, &dev->qdev, br->bus_name);
+    qbus_create_inplace(&sec_bus->qbus, typename, d, br->bus_name);
     sec_bus->parent_dev = dev;
     sec_bus->map_irq = br->map_irq ? br->map_irq : pci_swizzle_map_irq_fn;
     sec_bus->address_space_mem = &br->address_space_mem;