aboutsummaryrefslogtreecommitdiff
path: root/hw/spapr_pci.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-08-20 19:08:08 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2012-08-22 10:47:17 -0500
commit8558d942b665a9ff0847851615e107308f6386a5 (patch)
treee7686af2dc1fd9bc80b8a67baebd2b232347c2ce /hw/spapr_pci.c
parentb44ff9d430c5f2b51872f542d9562a15f0061a82 (diff)
pci: Derive PCI host bridges from TYPE_PCI_HOST_BRIDGE
Use PCIHostState and PCI_HOST_BRIDGE() where appropriate. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/spapr_pci.c')
-rw-r--r--hw/spapr_pci.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c
index f9dd2a8203..661c05bc30 100644
--- a/hw/spapr_pci.c
+++ b/hw/spapr_pci.c
@@ -64,7 +64,7 @@ static PCIDevice *find_dev(sPAPREnvironment *spapr, uint64_t buid,
uint32_t config_addr)
{
sPAPRPHBState *sphb = find_phb(spapr, buid);
- PCIHostState *phb = &sphb->host_state;
+ PCIHostState *phb = PCI_HOST_BRIDGE(sphb);
BusState *bus = BUS(phb->bus);
BusChild *kid;
int devfn = (config_addr >> 8) & 0xFF;
@@ -517,7 +517,7 @@ static DMAContext *spapr_pci_dma_context_fn(PCIBus *bus, void *opaque,
static int spapr_phb_init(SysBusDevice *s)
{
sPAPRPHBState *sphb = SPAPR_PCI_HOST_BRIDGE(s);
- PCIHostState *phb = FROM_SYSBUS(PCIHostState, s);
+ PCIHostState *phb = PCI_HOST_BRIDGE(s);
char *namebuf;
int i;
PCIBus *bus;
@@ -617,7 +617,7 @@ static void spapr_phb_class_init(ObjectClass *klass, void *data)
static const TypeInfo spapr_phb_info = {
.name = TYPE_SPAPR_PCI_HOST_BRIDGE,
- .parent = TYPE_SYS_BUS_DEVICE,
+ .parent = TYPE_PCI_HOST_BRIDGE,
.instance_size = sizeof(sPAPRPHBState),
.class_init = spapr_phb_class_init,
};