Subject: [PATCH] powerpc: another use of zalloc_maybe_bootmem()

From: [email-masked] (Linas Vepstas)
Date: Tue, 2 Oct 2007 16:40:12 -0500

Use alloc_maybe_bootmem() which wraps the if(mem_init_done)
malloc clause.

Signed-off-by: Linas Vepstas <[email-masked]>

----
On Tue, Oct 02, 2007 at 01:37:53PM +1000, Stephen Rothwell wrote:
> This patch introduces zalloc_maybe_bootmem and uses it so that we don;t
> have to mark a whole (largish) routine as __init_ref_ok.

sfr missed a spot -- may as well get rid of this one too.

 arch/powerpc/kernel/pci-common.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Index: linux-2.6.23-rc8-mm1/arch/powerpc/kernel/pci-common.c
===================================================================
--- linux-2.6.23-rc8-mm1.orig/arch/powerpc/kernel/pci-common.c	2007-09-26 15:02:41.000000000 -0500
+++ linux-2.6.23-rc8-mm1/arch/powerpc/kernel/pci-common.c	2007-10-02 16:28:16.000000000 -0500
@@ -65,14 +65,11 @@ static void __devinit pci_setup_pci_cont
 	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);