diff options
author | Andreas Färber <afaerber@suse.de> | 2012-08-20 19:08:05 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-08-22 10:47:17 -0500 |
commit | 8c9f64df3dd76c253e4961c5d2f075bffcc29e1d (patch) | |
tree | eadc12864a91f1073c2706bde8043d46e1c42337 /hw/spapr.c | |
parent | 03a6b667702b0af0e7b36754489aed6aa82d30a1 (diff) |
spapr_pci: QOM'ify sPAPR PCI host bridge
Introduce type constant. Introduce cast macro to drop bogus busdev field
that would've broken SYS_BUS_DEVICE(). Avoid accessing parent fields
directly.
Free the identifier phb as acronym for PCI_HOST_BRIDGE.
Updated against conflicting merge from branch 'agraf/ppc-for-upstream'
(0d16fdd732d1b211842fa96b7c90ddf9e6bde0e4), which removed busdev field
differently, moved some code around and added new occurrences of 'phb'.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/spapr.c')
-rw-r--r-- | hw/spapr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/spapr.c b/hw/spapr.c index be533ee934..f8b53e9c1e 100644 --- a/hw/spapr.c +++ b/hw/spapr.c @@ -612,6 +612,7 @@ static void ppc_spapr_init(ram_addr_t ram_size, { PowerPCCPU *cpu; CPUPPCState *env; + PCIHostState *phb; int i; MemoryRegion *sysmem = get_system_memory(); MemoryRegion *ram = g_new(MemoryRegion, 1); @@ -742,6 +743,7 @@ static void ppc_spapr_init(ram_addr_t ram_size, SPAPR_PCI_MEM_WIN_SIZE, SPAPR_PCI_IO_WIN_ADDR, SPAPR_PCI_MSI_WIN_ADDR); + phb = &QLIST_FIRST(&spapr->phbs)->host_state; for (i = 0; i < nb_nics; i++) { NICInfo *nd = &nd_table[i]; @@ -762,13 +764,12 @@ static void ppc_spapr_init(ram_addr_t ram_size, } /* Graphics */ - if (spapr_vga_init(QLIST_FIRST(&spapr->phbs)->host_state.bus)) { + if (spapr_vga_init(phb->bus)) { spapr->has_graphics = true; } if (usb_enabled) { - pci_create_simple(QLIST_FIRST(&spapr->phbs)->host_state.bus, - -1, "pci-ohci"); + pci_create_simple(phb->bus, -1, "pci-ohci"); if (spapr->has_graphics) { usbdevice_create("keyboard"); usbdevice_create("mouse"); |