Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=749e80810d26c8d522b089718f22bb92d7834a37
Commit:     749e80810d26c8d522b089718f22bb92d7834a37
Parent:     80a7cc6cf1126bc09beee3dded2820bfa18ce347
Author:     Roy Zang <[EMAIL PROTECTED]>
AuthorDate: Fri Jun 1 16:05:38 2007 +0800
Committer:  Kumar Gala <[EMAIL PROTECTED]>
CommitDate: Mon Jul 9 23:24:50 2007 -0500

    [POWERPC] Remove redundant pci_read_irq_line() function for 85xx platform
    
    Remove redundant pci_read_irq_line() function for 85xx CDS board.
    This function has been realized in common ppc pci code.
    
    Signed-off-by: Roy Zang <[EMAIL PROTECTED]>
    Acked-by: Andy Fleming <[EMAIL PROTECTED]>
    Acked-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
    Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/85xx/mpc85xx_cds.c |   76 +++++++++++++----------------
 1 files changed, 34 insertions(+), 42 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c 
b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 2a80c1d..50c8d64 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -69,52 +69,44 @@ static int mpc85xx_exclude_device(struct pci_controller 
*hose,
                return PCIBIOS_SUCCESSFUL;
 }
 
-static void __init mpc85xx_cds_pcibios_fixup(void)
+static void __init mpc85xx_cds_pci_irq_fixup(struct pci_dev *dev)
 {
-       struct pci_dev *dev;
-       u_char          c;
-
-       if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
-                                       PCI_DEVICE_ID_VIA_82C586_1, NULL))) {
+       u_char c;
+       if (dev->vendor == PCI_VENDOR_ID_VIA) {
+               switch (dev->device) {
+               case PCI_DEVICE_ID_VIA_82C586_1:
+                       /*
+                        * U-Boot does not set the enable bits
+                        * for the IDE device. Force them on here.
+                        */
+                       pci_read_config_byte(dev, 0x40, &c);
+                       c |= 0x03; /* IDE: Chip Enable Bits */
+                       pci_write_config_byte(dev, 0x40, c);
+
+                       /*
+                        * Since only primary interface works, force the
+                        * IDE function to standard primary IDE interrupt
+                        * w/ 8259 offset
+                        */
+                       dev->irq = 14;
+                       pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 
dev->irq);
+                       break;
                /*
-                * U-Boot does not set the enable bits
-                * for the IDE device. Force them on here.
+                * Force legacy USB interrupt routing
                 */
-               pci_read_config_byte(dev, 0x40, &c);
-               c |= 0x03; /* IDE: Chip Enable Bits */
-               pci_write_config_byte(dev, 0x40, c);
-
-               /*
-                * Since only primary interface works, force the
-                * IDE function to standard primary IDE interrupt
-                * w/ 8259 offset
+               case PCI_DEVICE_ID_VIA_82C586_2:
+               /* There are two USB controllers.
+                * Identify them by functon number
                 */
-               dev->irq = 14;
-               pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
-               pci_dev_put(dev);
-       }
-
-       /*
-        * Force legacy USB interrupt routing
-        */
-       if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
-                                       PCI_DEVICE_ID_VIA_82C586_2, NULL))) {
-               dev->irq = 10;
-               pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 10);
-               pci_dev_put(dev);
-       }
-
-       if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
-                                       PCI_DEVICE_ID_VIA_82C586_2, dev))) {
-               dev->irq = 11;
-               pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 11);
-               pci_dev_put(dev);
+                       if (PCI_FUNC(dev->devfn))
+                               dev->irq = 11;
+                       else
+                               dev->irq = 10;
+                       pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 
dev->irq);
+               default:
+                       break;
+               }
        }
-
-       /* Now map all the PCI irqs */
-       dev = NULL;
-       for_each_pci_dev(dev)
-               pci_read_irq_line(dev);
 }
 
 #ifdef CONFIG_PPC_I8259
@@ -229,7 +221,7 @@ static void __init mpc85xx_cds_setup_arch(void)
        for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
                mpc85xx_add_bridge(np);
 
-       ppc_md.pcibios_fixup = mpc85xx_cds_pcibios_fixup;
+       ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
        ppc_md.pci_exclude_device = mpc85xx_exclude_device;
 #endif
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to