]> err.no Git - linux-2.6/commitdiff
[POWERPC] Use alloc_maybe_bootmem() in pcibios_alloc_controller
authorLinas Vepstas <linas@austin.ibm.com>
Tue, 2 Oct 2007 21:40:12 +0000 (07:40 +1000)
committerPaul Mackerras <paulus@samba.org>
Wed, 3 Oct 2007 05:31:35 +0000 (15:31 +1000)
Use alloc_maybe_bootmem() which wraps the if (mem_init_done)
malloc clause.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/pci-common.c

index 083cfbdbe0b2d7ed86edeb2ab55d5a7284fd8a91..2ae3b6f778a3c4e5cff5922c10c96a705d44c2de 100644 (file)
@@ -65,14 +65,11 @@ static void __devinit pci_setup_pci_controller(struct pci_controller *hose)
        spin_unlock(&hose_spinlock);
 }
 
-__init_refok struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
+struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
 {
        struct pci_controller *phb;
 
-       if (mem_init_done)
-               phb = kmalloc(sizeof(struct pci_controller), GFP_KERNEL);
-       else
-               phb = alloc_bootmem(sizeof (struct pci_controller));
+       phb = alloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
        if (phb == NULL)
                return NULL;
        pci_setup_pci_controller(phb);