aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/pci-common.c34
-rw-r--r--arch/powerpc/platforms/pseries/pci_dlpar.c7
2 files changed, 3 insertions, 38 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 89c83ccb85c..063cdd41304 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1161,41 +1161,9 @@ EXPORT_SYMBOL_GPL(pcibios_claim_one_bus);
1161 1161
1162int pcibios_enable_device(struct pci_dev *dev, int mask) 1162int pcibios_enable_device(struct pci_dev *dev, int mask)
1163{ 1163{
1164 u16 cmd, old_cmd;
1165 int idx;
1166 struct resource *r;
1167
1168 if (ppc_md.pcibios_enable_device_hook) 1164 if (ppc_md.pcibios_enable_device_hook)
1169 if (ppc_md.pcibios_enable_device_hook(dev)) 1165 if (ppc_md.pcibios_enable_device_hook(dev))
1170 return -EINVAL; 1166 return -EINVAL;
1171 1167
1172 pci_read_config_word(dev, PCI_COMMAND, &cmd); 1168 return pci_enable_resources(dev, mask);
1173 old_cmd = cmd;
1174 for (idx = 0; idx < PCI_NUM_RESOURCES; idx++) {
1175 /* Only set up the requested stuff */
1176 if (!(mask & (1 << idx)))
1177 continue;
1178 r = &dev->resource[idx];
1179 if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM)))
1180 continue;
1181 if ((idx == PCI_ROM_RESOURCE) &&
1182 (!(r->flags & IORESOURCE_ROM_ENABLE)))
1183 continue;
1184 if (r->parent == NULL) {
1185 printk(KERN_ERR "PCI: Device %s not available because"
1186 " of resource collisions\n", pci_name(dev));
1187 return -EINVAL;
1188 }
1189 if (r->flags & IORESOURCE_IO)
1190 cmd |= PCI_COMMAND_IO;
1191 if (r->flags & IORESOURCE_MEM)
1192 cmd |= PCI_COMMAND_MEMORY;
1193 }
1194 if (cmd != old_cmd) {
1195 printk("PCI: Enabling device %s (%04x -> %04x)\n",
1196 pci_name(dev), old_cmd, cmd);
1197 pci_write_config_word(dev, PCI_COMMAND, cmd);
1198 }
1199 return 0;
1200} 1169}
1201
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c
index 0d7229cde0e..21a6d55418f 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -88,11 +88,8 @@ pcibios_fixup_new_pci_devices(struct pci_bus *bus)
88 struct pci_dev *dev; 88 struct pci_dev *dev;
89 89
90 list_for_each_entry(dev, &bus->devices, bus_list) { 90 list_for_each_entry(dev, &bus->devices, bus_list) {
91 /* 91 /* Skip already-added devices */
92 * Skip already-present devices (which are on the 92 if (!dev->is_added) {
93 * global device list.)
94 */
95 if (list_empty(&dev->global_list)) {
96 int i; 93 int i;
97 94
98 /* Fill device archdata and setup iommu table */ 95 /* Fill device archdata and setup iommu table */