[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFT PATCH v1 19/30] pci-bridge/*: substitute ->qdev casts
From: |
peter . crosthwaite |
Subject: |
[Qemu-devel] [RFT PATCH v1 19/30] pci-bridge/*: substitute ->qdev casts with DEVICE() |
Date: |
Tue, 11 Jun 2013 16:54:26 +1000 |
From: Peter Crosthwaite <address@hidden>
Signed-off-by: Peter Crosthwaite <address@hidden>
---
hw/pci-bridge/i82801b11.c | 2 +-
hw/pci-bridge/ioh3420.c | 2 +-
hw/pci-bridge/xio3130_downstream.c | 2 +-
hw/pci-bridge/xio3130_upstream.c | 2 +-
hw/pci/pci_bridge.c | 7 ++++---
5 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
index 5807a92..8b20e27 100644
--- a/hw/pci-bridge/i82801b11.c
+++ b/hw/pci-bridge/i82801b11.c
@@ -108,7 +108,7 @@ PCIBus *ich9_d2pbr_init(PCIBus *bus, int devfn, int sec_bus)
return NULL;
}
br = DO_UPCAST(PCIBridge, dev, d);
- qdev = &br->dev.qdev;
+ qdev = DEVICE(br);
snprintf(buf, sizeof(buf), "pci.%d", sec_bus);
pci_bridge_map_irq(br, buf, pci_swizzle_map_irq_fn);
diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c
index bb541eb..32f9ed6 100644
--- a/hw/pci-bridge/ioh3420.c
+++ b/hw/pci-bridge/ioh3420.c
@@ -173,7 +173,7 @@ PCIESlot *ioh3420_init(PCIBus *bus, int devfn, bool
multifunction,
}
br = DO_UPCAST(PCIBridge, dev, d);
- qdev = &br->dev.qdev;
+ qdev = DEVICE(br);
pci_bridge_map_irq(br, bus_name, map_irq);
qdev_prop_set_uint8(qdev, "port", port);
qdev_prop_set_uint8(qdev, "chassis", chassis);
diff --git a/hw/pci-bridge/xio3130_downstream.c
b/hw/pci-bridge/xio3130_downstream.c
index 1810dd2..6a799e2 100644
--- a/hw/pci-bridge/xio3130_downstream.c
+++ b/hw/pci-bridge/xio3130_downstream.c
@@ -140,7 +140,7 @@ PCIESlot *xio3130_downstream_init(PCIBus *bus, int devfn,
bool multifunction,
}
br = DO_UPCAST(PCIBridge, dev, d);
- qdev = &br->dev.qdev;
+ qdev = DEVICE(br);
pci_bridge_map_irq(br, bus_name, map_irq);
qdev_prop_set_uint8(qdev, "port", port);
qdev_prop_set_uint8(qdev, "chassis", chassis);
diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstream.c
index 8e0d97a..9bb9daa 100644
--- a/hw/pci-bridge/xio3130_upstream.c
+++ b/hw/pci-bridge/xio3130_upstream.c
@@ -120,7 +120,7 @@ PCIEPort *xio3130_upstream_init(PCIBus *bus, int devfn,
bool multifunction,
}
br = DO_UPCAST(PCIBridge, dev, d);
- qdev = &br->dev.qdev;
+ qdev = DEVICE(br);
pci_bridge_map_irq(br, bus_name, map_irq);
qdev_prop_set_uint8(qdev, "port", port);
qdev_init_nofail(qdev);
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;
--
1.8.3.rc1.44.gb387c77.dirty
- [Qemu-devel] [RFT PATCH v1 10/30] acpi/piix4: QOM Upcast Sweep, (continued)
- [Qemu-devel] [RFT PATCH v1 10/30] acpi/piix4: QOM Upcast Sweep, peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 11/30] misc/pci-testdev: QOM Upcast Sweep, peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 12/30] virtio/virtio-pci: QOM casting sweep, peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 13/30] virtio/vmware_vga: QOM casting sweep, peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 14/30] misc/ivshmem: QOM Upcast Sweep, peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 15/30] xen/xen_platform: QOM casting sweep, peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 16/30] isa/*: QOM casting sweep, peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 17/30] pci/*: QOM casting sweep, peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 18/30] pci-bridge/pci_bridge_dev: Don't use DO_UPCAST, peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 19/30] pci-bridge/*: substitute ->qdev casts with DEVICE(),
peter . crosthwaite <=
- [Qemu-devel] [RFT PATCH v1 20/30] misc/vfio: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 21/30] net/eepro100: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 22/30] net/ne2000: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 23/30] usb/*: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 24/30] watchdog/wdt_i6300esb: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 25/30] scsi/vmw_pvscsi: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 26/30] i2c/smbus_ich9: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 27/30] ide/cmd646: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 28/30] ide/via: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/11
- [Qemu-devel] [RFT PATCH v1 29/30] pci-host/*: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/11