diff options
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 34 |
1 files changed, 1 insertions, 33 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 | ||
1162 | int pcibios_enable_device(struct pci_dev *dev, int mask) | 1162 | int 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 | |||