diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-03-04 13:56:56 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-21 00:47:05 -0400 |
commit | 7cfb5f9aaec6f0fc45ff323841e6d62f67e7ffad (patch) | |
tree | a15a086815a532bbe0f8a7c58cdaa566ed82d407 | |
parent | d981f163fe7af0c55db585fbf513a8e14803a6e8 (diff) |
PCI: powerpc: use generic pci_enable_resources()
Use the generic pci_enable_resources() instead of the arch-specific code.
The generic version is functionally equivalent, but uses dev_printk.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-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 89c83ccb85c1..063cdd413049 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 | |||