From 8c9f64df3dd76c253e4961c5d2f075bffcc29e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 20 Aug 2012 19:08:05 +0200 Subject: spapr_pci: QOM'ify sPAPR PCI host bridge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Anthony Liguori --- hw/spapr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'hw/spapr.c') diff --git a/hw/spapr.c b/hw/spapr.c index be533ee..f8b53e9 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"); -- cgit v1.1