]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/prom_parse.c
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / prom_parse.c
index a11d68976dc840fdf545120f94cda1c746a362c8..8f0856f312dab9d210a04d7b6b256745f9ea236c 100644 (file)
@@ -232,11 +232,6 @@ int of_pci_address_to_resource(struct device_node *dev, int bar,
 }
 EXPORT_SYMBOL_GPL(of_pci_address_to_resource);
 
-static u8 of_irq_pci_swizzle(u8 slot, u8 pin)
-{
-       return (((pin - 1) + slot) % 4) + 1;
-}
-
 int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq)
 {
        struct device_node *dn, *ppnode;
@@ -306,7 +301,7 @@ int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq)
                /* We can only get here if we hit a P2P bridge with no node,
                 * let's do standard swizzling and try again
                 */
-               lspec = of_irq_pci_swizzle(PCI_SLOT(pdev->devfn), lspec);
+               lspec = pci_swizzle_interrupt_pin(pdev, lspec);
                pdev = ppdev;
        }
 
@@ -734,10 +729,7 @@ void of_irq_map_init(unsigned int flags)
        if (flags & OF_IMAP_NO_PHANDLE) {
                struct device_node *np;
 
-               for(np = NULL; (np = of_find_all_nodes(np)) != NULL;) {
-                       if (of_get_property(np, "interrupt-controller", NULL)
-                           == NULL)
-                               continue;
+               for_each_node_with_property(np, "interrupt-controller") {
                        /* Skip /chosen/interrupt-controller */
                        if (strcmp(np->name, "chosen") == 0)
                                continue;