]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/microblaze/pci/pci-common.c
Merge remote-tracking branch 'grant/devicetree/next' into for-next
[karo-tx-linux.git] / arch / microblaze / pci / pci-common.c
index 7c8a35238f740bf2b61952cd067902a99584c7d5..66804adcacf02f3430c31f5d1ba275e5d04da382 100644 (file)
@@ -193,76 +193,6 @@ void pcibios_set_master(struct pci_dev *dev)
        /* No special bus mastering setup handling */
 }
 
-/*
- * Reads the interrupt pin to determine if interrupt is use by card.
- * If the interrupt is used, then gets the interrupt line from the
- * openfirmware and sets it in the pci_dev and pci_config line.
- */
-int pci_read_irq_line(struct pci_dev *pci_dev)
-{
-       struct of_irq oirq;
-       unsigned int virq;
-
-       /* The current device-tree that iSeries generates from the HV
-        * PCI informations doesn't contain proper interrupt routing,
-        * and all the fallback would do is print out crap, so we
-        * don't attempt to resolve the interrupts here at all, some
-        * iSeries specific fixup does it.
-        *
-        * In the long run, we will hopefully fix the generated device-tree
-        * instead.
-        */
-       pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev));
-
-#ifdef DEBUG
-       memset(&oirq, 0xff, sizeof(oirq));
-#endif
-       /* Try to get a mapping from the device-tree */
-       if (of_irq_map_pci(pci_dev, &oirq)) {
-               u8 line, pin;
-
-               /* If that fails, lets fallback to what is in the config
-                * space and map that through the default controller. We
-                * also set the type to level low since that's what PCI
-                * interrupts are. If your platform does differently, then
-                * either provide a proper interrupt tree or don't use this
-                * function.
-                */
-               if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin))
-                       return -1;
-               if (pin == 0)
-                       return -1;
-               if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
-                   line == 0xff || line == 0) {
-                       return -1;
-               }
-               pr_debug(" No map ! Using line %d (pin %d) from PCI config\n",
-                        line, pin);
-
-               virq = irq_create_mapping(NULL, line);
-               if (virq)
-                       irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
-       } else {
-               pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
-                        oirq.size, oirq.specifier[0], oirq.specifier[1],
-                        of_node_full_name(oirq.controller));
-
-               virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
-                                            oirq.size);
-       }
-       if (!virq) {
-               pr_debug(" Failed to map !\n");
-               return -1;
-       }
-
-       pr_debug(" Mapped to linux irq %d\n", virq);
-
-       pci_dev->irq = virq;
-
-       return 0;
-}
-EXPORT_SYMBOL(pci_read_irq_line);
-
 /*
  * Platform support for /proc/bus/pci/X/Y mmap()s,
  * modelled on the sparc64 implementation by Dave Miller.
@@ -961,7 +891,7 @@ void pcibios_setup_bus_devices(struct pci_bus *bus)
                dev->dev.archdata.dma_data = (void *)PCI_DRAM_OFFSET;
 
                /* Read default IRQs and fixup if necessary */
-               pci_read_irq_line(dev);
+               dev->irq = of_irq_parse_and_map_pci(dev, 0, 0);
        }
 }