Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e60516e3 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Paul Mackerras
Browse files

[POWERPC] Inline pci_setup_pci_controller as it has become trivial



and it becomes clear that we should use zalloc_maybe_bootmem.

Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 53761746
Loading
Loading
Loading
Loading
+6 −15
Original line number Diff line number Diff line
@@ -50,27 +50,18 @@ static DEFINE_SPINLOCK(hose_spinlock);
/* XXX kill that some day ... */
static int global_phb_number;		/* Global phb counter */

/*
 * pci_controller(phb) initialized common variables.
 */
static void __devinit pci_setup_pci_controller(struct pci_controller *hose)
{
	memset(hose, 0, sizeof(struct pci_controller));

	spin_lock(&hose_spinlock);
	hose->global_number = global_phb_number++;
	list_add_tail(&hose->list_node, &hose_list);
	spin_unlock(&hose_spinlock);
}

struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
{
	struct pci_controller *phb;

	phb = alloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
	phb = zalloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
	if (phb == NULL)
		return NULL;
	pci_setup_pci_controller(phb);
	spin_lock(&hose_spinlock);
	phb->global_number = global_phb_number++;
	list_add_tail(&phb->list_node, &hose_list);
	spin_unlock(&hose_spinlock);
	phb->arch_data = dev;
	phb->is_dynamic = mem_init_done;
#ifdef CONFIG_PPC64