]> err.no Git - linux-2.6/commitdiff
[POWERPC] mpc5200: Add common mpc52xx_setup_pci() routine
authorMarian Balakowicz <m8@semihalf.com>
Fri, 9 Nov 2007 17:11:56 +0000 (04:11 +1100)
committerGrant Likely <grant.likely@secretlab.ca>
Fri, 18 Jan 2008 16:30:07 +0000 (09:30 -0700)
This patch moves a generic pci init code from lite5200
platform file to a common mpc52xx_setup_pci() routine
and adds additional compatibility property verification.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
arch/powerpc/platforms/52xx/lite5200.c
arch/powerpc/platforms/52xx/mpc52xx_pci.c
include/asm-powerpc/mpc52xx.h

index 25d2bfa3d9dc0237c0c7d2299e94c863eaeade20..ce903bef004e10ecd0386a27a3c543916a3a2b9f 100644 (file)
@@ -131,10 +131,6 @@ static void lite5200_resume_finish(void __iomem *mbar)
 
 static void __init lite5200_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-       struct device_node *np;
-#endif
-
        if (ppc_md.progress)
                ppc_md.progress("lite5200_setup_arch()", 0);
 
@@ -154,13 +150,7 @@ static void __init lite5200_setup_arch(void)
        lite5200_pm_init();
 #endif
 
-#ifdef CONFIG_PCI
-       np = of_find_node_by_type(NULL, "pci");
-       if (np) {
-               mpc52xx_add_bridge(np);
-               of_node_put(np);
-       }
-#endif
+       mpc52xx_setup_pci();
 }
 
 /*
index 262eda8659d07ef31be4cc715153f5cc5943032d..4b79398b2e406e6301750b9987f180fc0b90d0eb 100644 (file)
@@ -406,3 +406,17 @@ mpc52xx_add_bridge(struct device_node *node)
 
        return 0;
 }
+
+void __init mpc52xx_setup_pci(void)
+{
+       struct device_node *pci;
+
+       pci = of_find_compatible_node(NULL, NULL, "fsl,mpc5200-pci");
+       if (!pci)
+               pci = of_find_compatible_node(NULL, NULL, "mpc5200-pci");
+       if (!pci)
+               return;
+
+       mpc52xx_add_bridge(pci);
+       of_node_put(pci);
+}
index fcb2ebbfddbcd2d0d4c2aa4704cdffed236207a9..d7efbe09f93bb459c3cdf1626ef88b7eb3e138f4 100644 (file)
@@ -257,7 +257,12 @@ extern void mpc52xx_declare_of_platform_devices(void);
 extern void mpc52xx_init_irq(void);
 extern unsigned int mpc52xx_get_irq(void);
 
+#ifdef CONFIG_PCI
 extern int __init mpc52xx_add_bridge(struct device_node *node);
+extern void __init mpc52xx_setup_pci(void);
+#else
+static inline void mpc52xx_setup_pci(void) { }
+#endif
 
 extern void __init mpc52xx_map_wdt(void);
 extern void mpc52xx_restart(char *cmd);