aboutsummaryrefslogtreecommitdiff
path: root/hw/pci-bridge/pci_bridge_dev.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-07-11 17:13:43 +0200
committerAndreas Färber <afaerber@suse.de>2013-07-29 20:44:47 +0200
commitf055e96bd4311d287c0e03faec02a1bdbc351925 (patch)
treeb2fd16ffacacbb26c7da89f171ffc027da4d8c39 /hw/pci-bridge/pci_bridge_dev.c
parent45c0a675f9572f236b4be881576de9a626d2618f (diff)
pci-bridge: Turn PCIBridge into abstract QOM type
Introduce TYPE_PCI_BRIDGE as base type and use PCI_BRIDGE() casts. Reviewed-by: Don Koch <dkoch@verizon.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> [AF: Updated pbm-bridge parent to TYPE_PCI_BRIDGE] Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/pci-bridge/pci_bridge_dev.c')
-rw-r--r--hw/pci-bridge/pci_bridge_dev.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
index a00642cf09..af750c21b2 100644
--- a/hw/pci-bridge/pci_bridge_dev.c
+++ b/hw/pci-bridge/pci_bridge_dev.c
@@ -38,7 +38,7 @@ typedef struct PCIBridgeDev PCIBridgeDev;
static int pci_bridge_dev_initfn(PCIDevice *dev)
{
- PCIBridge *br = DO_UPCAST(PCIBridge, dev, dev);
+ PCIBridge *br = PCI_BRIDGE(dev);
PCIBridgeDev *bridge_dev = DO_UPCAST(PCIBridgeDev, bridge, br);
int err;
@@ -81,7 +81,7 @@ bridge_error:
static void pci_bridge_dev_exitfn(PCIDevice *dev)
{
- PCIBridge *br = DO_UPCAST(PCIBridge, dev, dev);
+ PCIBridge *br = PCI_BRIDGE(dev);
PCIBridgeDev *bridge_dev = DO_UPCAST(PCIBridgeDev, bridge, br);
if (msi_present(dev)) {
msi_uninit(dev);
@@ -120,8 +120,8 @@ static Property pci_bridge_dev_properties[] = {
static const VMStateDescription pci_bridge_dev_vmstate = {
.name = "pci_bridge",
.fields = (VMStateField[]) {
- VMSTATE_PCI_DEVICE(bridge.dev, PCIBridgeDev),
- SHPC_VMSTATE(bridge.dev.shpc, PCIBridgeDev),
+ VMSTATE_PCI_DEVICE(bridge.parent_obj, PCIBridgeDev),
+ SHPC_VMSTATE(bridge.parent_obj.shpc, PCIBridgeDev),
VMSTATE_END_OF_LIST()
}
};
@@ -146,7 +146,7 @@ static void pci_bridge_dev_class_init(ObjectClass *klass, void *data)
static const TypeInfo pci_bridge_dev_info = {
.name = "pci-bridge",
- .parent = TYPE_PCI_DEVICE,
+ .parent = TYPE_PCI_BRIDGE,
.instance_size = sizeof(PCIBridgeDev),
.class_init = pci_bridge_dev_class_init,
};