aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/parisc/lba_pci.c51
-rw-r--r--drivers/parisc/pdc_stable.c11
-rw-r--r--drivers/parisc/sba_iommu.c4
-rw-r--r--drivers/parisc/superio.c4
4 files changed, 20 insertions, 50 deletions
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index 5b86ee5c1eeb..5eace9e66e14 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -557,44 +557,6 @@ lba_bios_init(void)
557#ifdef CONFIG_64BIT 557#ifdef CONFIG_64BIT
558 558
559/* 559/*
560** Determine if a device is already configured.
561** If so, reserve it resources.
562**
563** Read PCI cfg command register and see if I/O or MMIO is enabled.
564** PAT has to enable the devices it's using.
565**
566** Note: resources are fixed up before we try to claim them.
567*/
568static void
569lba_claim_dev_resources(struct pci_dev *dev)
570{
571 u16 cmd;
572 int i, srch_flags;
573
574 (void) pci_read_config_word(dev, PCI_COMMAND, &cmd);
575
576 srch_flags = (cmd & PCI_COMMAND_IO) ? IORESOURCE_IO : 0;
577 if (cmd & PCI_COMMAND_MEMORY)
578 srch_flags |= IORESOURCE_MEM;
579
580 if (!srch_flags)
581 return;
582
583 for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
584 if (dev->resource[i].flags & srch_flags) {
585 pci_claim_resource(dev, i);
586 DBG(" claimed %s %d [%lx,%lx]/%lx\n",
587 pci_name(dev), i,
588 dev->resource[i].start,
589 dev->resource[i].end,
590 dev->resource[i].flags
591 );
592 }
593 }
594}
595
596
597/*
598 * truncate_pat_collision: Deal with overlaps or outright collisions 560 * truncate_pat_collision: Deal with overlaps or outright collisions
599 * between PAT PDC reported ranges. 561 * between PAT PDC reported ranges.
600 * 562 *
@@ -653,7 +615,6 @@ truncate_pat_collision(struct resource *root, struct resource *new)
653} 615}
654 616
655#else 617#else
656#define lba_claim_dev_resources(dev) do { } while (0)
657#define truncate_pat_collision(r,n) (0) 618#define truncate_pat_collision(r,n) (0)
658#endif 619#endif
659 620
@@ -684,8 +645,12 @@ lba_fixup_bus(struct pci_bus *bus)
684 ** pci_alloc_primary_bus() mangles this. 645 ** pci_alloc_primary_bus() mangles this.
685 */ 646 */
686 if (bus->self) { 647 if (bus->self) {
648 int i;
687 /* PCI-PCI Bridge */ 649 /* PCI-PCI Bridge */
688 pci_read_bridge_bases(bus); 650 pci_read_bridge_bases(bus);
651 for (i = PCI_BRIDGE_RESOURCES; i < PCI_NUM_RESOURCES; i++) {
652 pci_claim_resource(bus->self, i);
653 }
689 } else { 654 } else {
690 /* Host-PCI Bridge */ 655 /* Host-PCI Bridge */
691 int err, i; 656 int err, i;
@@ -803,6 +768,9 @@ lba_fixup_bus(struct pci_bus *bus)
803 DBG("lba_fixup_bus() WTF? 0x%lx [%lx/%lx] XXX", 768 DBG("lba_fixup_bus() WTF? 0x%lx [%lx/%lx] XXX",
804 res->flags, res->start, res->end); 769 res->flags, res->start, res->end);
805 } 770 }
771 if ((i != PCI_ROM_RESOURCE) ||
772 (res->flags & IORESOURCE_ROM_ENABLE))
773 pci_claim_resource(dev, i);
806 } 774 }
807 775
808#ifdef FBB_SUPPORT 776#ifdef FBB_SUPPORT
@@ -814,11 +782,6 @@ lba_fixup_bus(struct pci_bus *bus)
814 bus->bridge_ctl &= ~(status & PCI_STATUS_FAST_BACK); 782 bus->bridge_ctl &= ~(status & PCI_STATUS_FAST_BACK);
815#endif 783#endif
816 784
817 if (is_pdc_pat()) {
818 /* Claim resources for PDC's devices */
819 lba_claim_dev_resources(dev);
820 }
821
822 /* 785 /*
823 ** P2PB's have no IRQs. ignore them. 786 ** P2PB's have no IRQs. ignore them.
824 */ 787 */
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c
index fc4bde259dc7..ebb09e98d215 100644
--- a/drivers/parisc/pdc_stable.c
+++ b/drivers/parisc/pdc_stable.c
@@ -282,6 +282,7 @@ pdcspath_hwpath_write(struct pdcspath_entry *entry, const char *buf, size_t coun
282 unsigned short i; 282 unsigned short i;
283 char in[count+1], *temp; 283 char in[count+1], *temp;
284 struct device *dev; 284 struct device *dev;
285 int ret;
285 286
286 if (!entry || !buf || !count) 287 if (!entry || !buf || !count)
287 return -EINVAL; 288 return -EINVAL;
@@ -333,7 +334,9 @@ pdcspath_hwpath_write(struct pdcspath_entry *entry, const char *buf, size_t coun
333 334
334 /* Update the symlink to the real device */ 335 /* Update the symlink to the real device */
335 sysfs_remove_link(&entry->kobj, "device"); 336 sysfs_remove_link(&entry->kobj, "device");
336 sysfs_create_link(&entry->kobj, &entry->dev->kobj, "device"); 337 ret = sysfs_create_link(&entry->kobj, &entry->dev->kobj, "device");
338 WARN_ON(ret);
339
337 write_unlock(&entry->rw_lock); 340 write_unlock(&entry->rw_lock);
338 341
339 printk(KERN_INFO PDCS_PREFIX ": changed \"%s\" path to \"%s\"\n", 342 printk(KERN_INFO PDCS_PREFIX ": changed \"%s\" path to \"%s\"\n",
@@ -1003,8 +1006,10 @@ pdcs_register_pathentries(void)
1003 entry->ready = 2; 1006 entry->ready = 2;
1004 1007
1005 /* Add a nice symlink to the real device */ 1008 /* Add a nice symlink to the real device */
1006 if (entry->dev) 1009 if (entry->dev) {
1007 sysfs_create_link(&entry->kobj, &entry->dev->kobj, "device"); 1010 err = sysfs_create_link(&entry->kobj, &entry->dev->kobj, "device");
1011 WARN_ON(err);
1012 }
1008 1013
1009 write_unlock(&entry->rw_lock); 1014 write_unlock(&entry->rw_lock);
1010 } 1015 }
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index d044c48323e6..e5c323936eae 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -1909,8 +1909,8 @@ sba_driver_callback(struct parisc_device *dev)
1909 global_ioc_cnt *= 2; 1909 global_ioc_cnt *= 2;
1910 } 1910 }
1911 1911
1912 printk(KERN_INFO "%s found %s at 0x%lx\n", 1912 printk(KERN_INFO "%s found %s at 0x%llx\n",
1913 MODULE_NAME, version, dev->hpa.start); 1913 MODULE_NAME, version, (unsigned long long)dev->hpa.start);
1914 1914
1915 sba_dev = kzalloc(sizeof(struct sba_device), GFP_KERNEL); 1915 sba_dev = kzalloc(sizeof(struct sba_device), GFP_KERNEL);
1916 if (!sba_dev) { 1916 if (!sba_dev) {
diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c
index 38cdf9fa36a7..1e8d2d17f04c 100644
--- a/drivers/parisc/superio.c
+++ b/drivers/parisc/superio.c
@@ -155,6 +155,7 @@ superio_init(struct pci_dev *pcidev)
155 struct superio_device *sio = &sio_dev; 155 struct superio_device *sio = &sio_dev;
156 struct pci_dev *pdev = sio->lio_pdev; 156 struct pci_dev *pdev = sio->lio_pdev;
157 u16 word; 157 u16 word;
158 int ret;
158 159
159 if (sio->suckyio_irq_enabled) 160 if (sio->suckyio_irq_enabled)
160 return; 161 return;
@@ -200,7 +201,8 @@ superio_init(struct pci_dev *pcidev)
200 pci_write_config_word (pdev, PCI_COMMAND, word); 201 pci_write_config_word (pdev, PCI_COMMAND, word);
201 202
202 pci_set_master (pdev); 203 pci_set_master (pdev);
203 pci_enable_device(pdev); 204 ret = pci_enable_device(pdev);
205 BUG_ON(ret < 0); /* not too much we can do about this... */
204 206
205 /* 207 /*
206 * Next project is programming the onboard interrupt controllers. 208 * Next project is programming the onboard interrupt controllers.