Skip to content

Commit

Permalink
[POWERPC] Use alloc_maybe_bootmem() in pcibios_alloc_controller
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linas Vepstas authored and Paul Mackerras committed Oct 3, 2007
1 parent da0bd34 commit 2d5f565
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions arch/powerpc/kernel/pci-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2d5f565

Please sign in to comment.