diff options
| author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-12-10 19:02:07 -0500 |
|---|---|---|
| committer | Paul Mackerras <paulus@samba.org> | 2007-12-10 21:42:31 -0500 |
| commit | e60516e3d0bbde450acf4397b0d01b03042a7d57 (patch) | |
| tree | b212b1b6881346b9e21a11925c134e2bf8f9be85 | |
| parent | 53761746ec98c526c7d82dcf8246cbde9f09e743 (diff) | |
[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: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
| -rw-r--r-- | arch/powerpc/kernel/pci-common.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 15ec71a84f78..78cdb700451c 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
| @@ -50,27 +50,18 @@ static DEFINE_SPINLOCK(hose_spinlock); | |||
| 50 | /* XXX kill that some day ... */ | 50 | /* XXX kill that some day ... */ |
| 51 | static int global_phb_number; /* Global phb counter */ | 51 | static int global_phb_number; /* Global phb counter */ |
| 52 | 52 | ||
| 53 | /* | ||
| 54 | * pci_controller(phb) initialized common variables. | ||
| 55 | */ | ||
| 56 | static void __devinit pci_setup_pci_controller(struct pci_controller *hose) | ||
| 57 | { | ||
| 58 | memset(hose, 0, sizeof(struct pci_controller)); | ||
| 59 | 53 | ||
| 60 | spin_lock(&hose_spinlock); | 54 | struct pci_controller *pcibios_alloc_controller(struct device_node *dev) |
| 61 | hose->global_number = global_phb_number++; | ||
| 62 | list_add_tail(&hose->list_node, &hose_list); | ||
| 63 | spin_unlock(&hose_spinlock); | ||
| 64 | } | ||
| 65 | |||
| 66 | struct pci_controller * pcibios_alloc_controller(struct device_node *dev) | ||
| 67 | { | 55 | { |
| 68 | struct pci_controller *phb; | 56 | struct pci_controller *phb; |
| 69 | 57 | ||
| 70 | phb = alloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL); | 58 | phb = zalloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL); |
| 71 | if (phb == NULL) | 59 | if (phb == NULL) |
| 72 | return NULL; | 60 | return NULL; |
| 73 | pci_setup_pci_controller(phb); | 61 | spin_lock(&hose_spinlock); |
| 62 | phb->global_number = global_phb_number++; | ||
| 63 | list_add_tail(&phb->list_node, &hose_list); | ||
| 64 | spin_unlock(&hose_spinlock); | ||
| 74 | phb->arch_data = dev; | 65 | phb->arch_data = dev; |
| 75 | phb->is_dynamic = mem_init_done; | 66 | phb->is_dynamic = mem_init_done; |
| 76 | #ifdef CONFIG_PPC64 | 67 | #ifdef CONFIG_PPC64 |
