diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-09-17 00:08:06 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-09-19 01:25:34 -0400 |
commit | 7b2c3c5b1d6dd77d7bb5a7d57ab7280e051c59bc (patch) | |
tree | 30fc4b8515f3838973386697e55647079a6921fa /arch/powerpc/platforms/celleb/pci.c | |
parent | ee983079ce04641523b23b8ed02cc3503632351e (diff) |
[POWERPC] Fix section mismatch in PCI code
Create a helper function (alloc_maybe_bootmem) that is marked __init_refok
to limit the chances of mistakenly referring to other __init routines.
WARNING: vmlinux.o(.text+0x2a9c4): Section mismatch: reference to .init.text:.__alloc_bootmem (between '.update_dn_pci_info' and '.pci_dn_reconfig_notifier')
WARNING: vmlinux.o(.text+0x36430): Section mismatch: reference to .init.text:.__alloc_bootmem (between '.mpic_msi_init_allocator' and '.find_ht_magic_addr')
WARNING: vmlinux.o(.text+0x5e804): Section mismatch: reference to .init.text:.__alloc_bootmem (between '.celleb_setup_phb' and '.celleb_fake_pci_write_config')
WARNING: vmlinux.o(.text+0x5e8e8): Section mismatch: reference to .init.text:.__alloc_bootmem (between '.celleb_setup_phb' and '.celleb_fake_pci_write_config')
WARNING: vmlinux.o(.text+0x5e968): Section mismatch: reference to .init.text:.__alloc_bootmem (between '.celleb_setup_phb' and '.celleb_fake_pci_write_config')
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/celleb/pci.c')
-rw-r--r-- | arch/powerpc/platforms/celleb/pci.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/arch/powerpc/platforms/celleb/pci.c b/arch/powerpc/platforms/celleb/pci.c index 11336b40feca..1348b23cbbc9 100644 --- a/arch/powerpc/platforms/celleb/pci.c +++ b/arch/powerpc/platforms/celleb/pci.c | |||
@@ -327,10 +327,7 @@ static int __init celleb_setup_fake_pci_device(struct device_node *node, | |||
327 | 327 | ||
328 | size = 256; | 328 | size = 256; |
329 | config = &private->fake_config[devno][fn]; | 329 | config = &private->fake_config[devno][fn]; |
330 | if (mem_init_done) | 330 | *config = alloc_maybe_bootmem(size, GFP_KERNEL); |
331 | *config = kzalloc(size, GFP_KERNEL); | ||
332 | else | ||
333 | *config = alloc_bootmem(size); | ||
334 | if (*config == NULL) { | 331 | if (*config == NULL) { |
335 | printk(KERN_ERR "PCI: " | 332 | printk(KERN_ERR "PCI: " |
336 | "not enough memory for fake configuration space\n"); | 333 | "not enough memory for fake configuration space\n"); |
@@ -341,10 +338,7 @@ static int __init celleb_setup_fake_pci_device(struct device_node *node, | |||
341 | 338 | ||
342 | size = sizeof(struct celleb_pci_resource); | 339 | size = sizeof(struct celleb_pci_resource); |
343 | res = &private->res[devno][fn]; | 340 | res = &private->res[devno][fn]; |
344 | if (mem_init_done) | 341 | *res = alloc_maybe_bootmem(size, GFP_KERNEL); |
345 | *res = kzalloc(size, GFP_KERNEL); | ||
346 | else | ||
347 | *res = alloc_bootmem(size); | ||
348 | if (*res == NULL) { | 342 | if (*res == NULL) { |
349 | printk(KERN_ERR | 343 | printk(KERN_ERR |
350 | "PCI: not enough memory for resource data space\n"); | 344 | "PCI: not enough memory for resource data space\n"); |
@@ -436,12 +430,9 @@ static int __init phb_set_bus_ranges(struct device_node *dev, | |||
436 | 430 | ||
437 | static void __init celleb_alloc_private_mem(struct pci_controller *hose) | 431 | static void __init celleb_alloc_private_mem(struct pci_controller *hose) |
438 | { | 432 | { |
439 | if (mem_init_done) | 433 | hose->private_data = |
440 | hose->private_data = | 434 | alloc_maybe_bootmem(sizeof(struct celleb_pci_private), |
441 | kzalloc(sizeof(struct celleb_pci_private), GFP_KERNEL); | 435 | GFP_KERNEL); |
442 | else | ||
443 | hose->private_data = | ||
444 | alloc_bootmem(sizeof(struct celleb_pci_private)); | ||
445 | } | 436 | } |
446 | 437 | ||
447 | int __init celleb_setup_phb(struct pci_controller *phb) | 438 | int __init celleb_setup_phb(struct pci_controller *phb) |