aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/pci/pci.c')
-rw-r--r--arch/ia64/pci/pci.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index c0661d3382e4..2a1487758490 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -418,18 +418,24 @@ pcibios_enable_resources (struct pci_dev *dev, int mask)
418 u16 cmd, old_cmd; 418 u16 cmd, old_cmd;
419 int idx; 419 int idx;
420 struct resource *r; 420 struct resource *r;
421 unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM;
421 422
422 if (!dev) 423 if (!dev)
423 return -EINVAL; 424 return -EINVAL;
424 425
425 pci_read_config_word(dev, PCI_COMMAND, &cmd); 426 pci_read_config_word(dev, PCI_COMMAND, &cmd);
426 old_cmd = cmd; 427 old_cmd = cmd;
427 for (idx=0; idx<6; idx++) { 428 for (idx=0; idx<PCI_NUM_RESOURCES; idx++) {
428 /* Only set up the desired resources. */ 429 /* Only set up the desired resources. */
429 if (!(mask & (1 << idx))) 430 if (!(mask & (1 << idx)))
430 continue; 431 continue;
431 432
432 r = &dev->resource[idx]; 433 r = &dev->resource[idx];
434 if (!(r->flags & type_mask))
435 continue;
436 if ((idx == PCI_ROM_RESOURCE) &&
437 (!(r->flags & IORESOURCE_ROM_ENABLE)))
438 continue;
433 if (!r->start && r->end) { 439 if (!r->start && r->end) {
434 printk(KERN_ERR 440 printk(KERN_ERR
435 "PCI: Device %s not available because of resource collisions\n", 441 "PCI: Device %s not available because of resource collisions\n",
@@ -441,8 +447,6 @@ pcibios_enable_resources (struct pci_dev *dev, int mask)
441 if (r->flags & IORESOURCE_MEM) 447 if (r->flags & IORESOURCE_MEM)
442 cmd |= PCI_COMMAND_MEMORY; 448 cmd |= PCI_COMMAND_MEMORY;
443 } 449 }
444 if (dev->resource[PCI_ROM_RESOURCE].start)
445 cmd |= PCI_COMMAND_MEMORY;
446 if (cmd != old_cmd) { 450 if (cmd != old_cmd) {
447 printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd); 451 printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd);
448 pci_write_config_word(dev, PCI_COMMAND, cmd); 452 pci_write_config_word(dev, PCI_COMMAND, cmd);