diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-12-19 22:54:57 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-20 00:18:11 -0500 |
commit | 549beb9ba3b03345cbd8e1233825d5b197a3f9f7 (patch) | |
tree | c192ba6cdfa13e9888d9e5f534d2862127d412cb /arch/powerpc/kernel/pci_32.c | |
parent | 24f8c827f9b8ab2c8644f7ab85a1b1d58fc0fcf7 (diff) |
[POWERPC] Merge 32 and 64 bits pcibios_enable_device
This merge the two implementations, based on the previously
fixed up 32 bits one. The pcibios_enable_device_hook in ppc_md
is now available for ppc64 use. Also remove the new unused
"initial" parameter from it and fixup users.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/pci_32.c')
-rw-r--r-- | arch/powerpc/kernel/pci_32.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index 12b74fd098ee..37cb7b944319 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c | |||
@@ -518,43 +518,6 @@ pcibios_update_irq(struct pci_dev *dev, int irq) | |||
518 | /* XXX FIXME - update OF device tree node interrupt property */ | 518 | /* XXX FIXME - update OF device tree node interrupt property */ |
519 | } | 519 | } |
520 | 520 | ||
521 | int pcibios_enable_device(struct pci_dev *dev, int mask) | ||
522 | { | ||
523 | u16 cmd, old_cmd; | ||
524 | int idx; | ||
525 | struct resource *r; | ||
526 | |||
527 | if (ppc_md.pcibios_enable_device_hook) | ||
528 | if (ppc_md.pcibios_enable_device_hook(dev, 0)) | ||
529 | return -EINVAL; | ||
530 | |||
531 | pci_read_config_word(dev, PCI_COMMAND, &cmd); | ||
532 | old_cmd = cmd; | ||
533 | for (idx = 0; idx < PCI_NUM_RESOURCES; idx++) { | ||
534 | /* Only set up the requested stuff */ | ||
535 | if (!(mask & (1 << idx))) | ||
536 | continue; | ||
537 | r = &dev->resource[idx]; | ||
538 | if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM))) | ||
539 | continue; | ||
540 | if (r->flags & IORESOURCE_UNSET) { | ||
541 | printk(KERN_ERR "PCI: Device %s not available because" | ||
542 | " of resource collisions\n", pci_name(dev)); | ||
543 | return -EINVAL; | ||
544 | } | ||
545 | if (r->flags & IORESOURCE_IO) | ||
546 | cmd |= PCI_COMMAND_IO; | ||
547 | if (r->flags & IORESOURCE_MEM) | ||
548 | cmd |= PCI_COMMAND_MEMORY; | ||
549 | } | ||
550 | if (cmd != old_cmd) { | ||
551 | printk("PCI: Enabling device %s (%04x -> %04x)\n", | ||
552 | pci_name(dev), old_cmd, cmd); | ||
553 | pci_write_config_word(dev, PCI_COMMAND, cmd); | ||
554 | } | ||
555 | return 0; | ||
556 | } | ||
557 | |||
558 | static struct pci_controller* | 521 | static struct pci_controller* |
559 | pci_bus_to_hose(int bus) | 522 | pci_bus_to_hose(int bus) |
560 | { | 523 | { |