diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-21 18:58:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-21 18:58:35 -0400 |
commit | bda0c0afa7a694bb1459fd023515aca681e4d79a (patch) | |
tree | cd8b9d9811463de2065cbe79d59689082d6c53cf /arch/ppc | |
parent | 904e0ab54b7591b9cb01cfc0dbbedcc8bc0d949b (diff) | |
parent | af40b485ea2d957ae2f237ab0e33539ae8f29562 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6: (42 commits)
PCI: Change PCI subsystem MAINTAINER
PCI: pci-iommu-iotlb-flushing-speedup
PCI: pci_setup_bridge() mustn't be __devinit
PCI: pci_bus_size_cardbus() mustn't be __devinit
PCI: pci_scan_device() mustn't be __devinit
PCI: pci_alloc_child_bus() mustn't be __devinit
PCI: replace remaining __FUNCTION__ occurrences
PCI: Hotplug: fakephp: Return success, not ENODEV, when bus rescan is triggered
PCI: Hotplug: Fix leaks in IBM Hot Plug Controller Driver - ibmphp_init_devno()
PCI: clean up resource alignment management
PCI: aerdrv_acpi.c: remove unneeded NULL check
PCI: Update VIA CX700 quirk
PCI: Expose PCI VPD through sysfs
PCI: iommu: iotlb flushing
PCI: simplify quirk debug output
PCI: iova RB tree setup tweak
PCI: parisc: use generic pci_enable_resources()
PCI: ppc: use generic pci_enable_resources()
PCI: powerpc: use generic pci_enable_resources()
PCI: ia64: use generic pci_enable_resources()
...
Diffstat (limited to 'arch/ppc')
-rw-r--r-- | arch/ppc/kernel/pci.c | 59 |
1 files changed, 2 insertions, 57 deletions
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c index c2ec13bea00..50ce83f20ad 100644 --- a/arch/ppc/kernel/pci.c +++ b/arch/ppc/kernel/pci.c | |||
@@ -578,39 +578,6 @@ pcibios_assign_resources(void) | |||
578 | } | 578 | } |
579 | 579 | ||
580 | 580 | ||
581 | int | ||
582 | pcibios_enable_resources(struct pci_dev *dev, int mask) | ||
583 | { | ||
584 | u16 cmd, old_cmd; | ||
585 | int idx; | ||
586 | struct resource *r; | ||
587 | |||
588 | pci_read_config_word(dev, PCI_COMMAND, &cmd); | ||
589 | old_cmd = cmd; | ||
590 | for (idx=0; idx<6; idx++) { | ||
591 | /* Only set up the requested stuff */ | ||
592 | if (!(mask & (1<<idx))) | ||
593 | continue; | ||
594 | |||
595 | r = &dev->resource[idx]; | ||
596 | if (r->flags & IORESOURCE_UNSET) { | ||
597 | printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev)); | ||
598 | return -EINVAL; | ||
599 | } | ||
600 | if (r->flags & IORESOURCE_IO) | ||
601 | cmd |= PCI_COMMAND_IO; | ||
602 | if (r->flags & IORESOURCE_MEM) | ||
603 | cmd |= PCI_COMMAND_MEMORY; | ||
604 | } | ||
605 | if (dev->resource[PCI_ROM_RESOURCE].start) | ||
606 | cmd |= PCI_COMMAND_MEMORY; | ||
607 | if (cmd != old_cmd) { | ||
608 | printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd); | ||
609 | pci_write_config_word(dev, PCI_COMMAND, cmd); | ||
610 | } | ||
611 | return 0; | ||
612 | } | ||
613 | |||
614 | static int next_controller_index; | 581 | static int next_controller_index; |
615 | 582 | ||
616 | struct pci_controller * __init | 583 | struct pci_controller * __init |
@@ -785,33 +752,11 @@ pcibios_update_irq(struct pci_dev *dev, int irq) | |||
785 | 752 | ||
786 | int pcibios_enable_device(struct pci_dev *dev, int mask) | 753 | int pcibios_enable_device(struct pci_dev *dev, int mask) |
787 | { | 754 | { |
788 | u16 cmd, old_cmd; | ||
789 | int idx; | ||
790 | struct resource *r; | ||
791 | |||
792 | if (ppc_md.pcibios_enable_device_hook) | 755 | if (ppc_md.pcibios_enable_device_hook) |
793 | if (ppc_md.pcibios_enable_device_hook(dev, 0)) | 756 | if (ppc_md.pcibios_enable_device_hook(dev, 0)) |
794 | return -EINVAL; | 757 | return -EINVAL; |
795 | 758 | ||
796 | pci_read_config_word(dev, PCI_COMMAND, &cmd); | 759 | return pci_enable_resources(dev, mask); |
797 | old_cmd = cmd; | ||
798 | for (idx=0; idx<6; idx++) { | ||
799 | r = &dev->resource[idx]; | ||
800 | if (r->flags & IORESOURCE_UNSET) { | ||
801 | printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev)); | ||
802 | return -EINVAL; | ||
803 | } | ||
804 | if (r->flags & IORESOURCE_IO) | ||
805 | cmd |= PCI_COMMAND_IO; | ||
806 | if (r->flags & IORESOURCE_MEM) | ||
807 | cmd |= PCI_COMMAND_MEMORY; | ||
808 | } | ||
809 | if (cmd != old_cmd) { | ||
810 | printk("PCI: Enabling device %s (%04x -> %04x)\n", | ||
811 | pci_name(dev), old_cmd, cmd); | ||
812 | pci_write_config_word(dev, PCI_COMMAND, cmd); | ||
813 | } | ||
814 | return 0; | ||
815 | } | 760 | } |
816 | 761 | ||
817 | struct pci_controller* | 762 | struct pci_controller* |