QE: use subsys_initcall to init qe
authorZhao Qiang <qiang.zhao@freescale.com>
Mon, 30 Nov 2015 02:48:56 +0000 (10:48 +0800)
committerScott Wood <scottwood@freescale.com>
Tue, 22 Dec 2015 23:10:18 +0000 (17:10 -0600)
Use subsys_initcall to init qe to adapt ARM architecture.
Remove qe_reset from PowerPC platform file.

Signed-off-by: Zhao Qiang <qiang.zhao@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
arch/powerpc/platforms/83xx/km83xx.c
arch/powerpc/platforms/83xx/mpc832x_mds.c
arch/powerpc/platforms/83xx/mpc832x_rdb.c
arch/powerpc/platforms/83xx/mpc836x_mds.c
arch/powerpc/platforms/83xx/mpc836x_rdk.c
arch/powerpc/platforms/85xx/common.c
arch/powerpc/sysdev/qe_lib/qe.c

index bf4c447..ae11158 100644 (file)
@@ -136,8 +136,6 @@ static void __init mpc83xx_km_setup_arch(void)
        mpc83xx_setup_pci();
 
 #ifdef CONFIG_QUICC_ENGINE
-       qe_reset();
-
        np = of_find_node_by_name(NULL, "par_io");
        if (np != NULL) {
                par_io_init(np);
index 8d76220..aacc43f 100644 (file)
@@ -74,8 +74,6 @@ static void __init mpc832x_sys_setup_arch(void)
        mpc83xx_setup_pci();
 
 #ifdef CONFIG_QUICC_ENGINE
-       qe_reset();
-
        if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
                par_io_init(np);
                of_node_put(np);
index eff5baa..0c7a43e 100644 (file)
@@ -203,8 +203,6 @@ static void __init mpc832x_rdb_setup_arch(void)
        mpc83xx_setup_pci();
 
 #ifdef CONFIG_QUICC_ENGINE
-       qe_reset();
-
        if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
                par_io_init(np);
                of_node_put(np);
index 1a26d2f..eb24abd 100644 (file)
@@ -82,8 +82,6 @@ static void __init mpc836x_mds_setup_arch(void)
        mpc83xx_setup_pci();
 
 #ifdef CONFIG_QUICC_ENGINE
-       qe_reset();
-
        if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) {
                par_io_init(np);
                of_node_put(np);
index b63b42d..823e370 100644 (file)
@@ -35,9 +35,6 @@ static void __init mpc836x_rdk_setup_arch(void)
                ppc_md.progress("mpc836x_rdk_setup_arch()", 0);
 
        mpc83xx_setup_pci();
-#ifdef CONFIG_QUICC_ENGINE
-       qe_reset();
-#endif
 }
 
 /*
index 23791de..18bca20 100644 (file)
@@ -105,7 +105,6 @@ void __init mpc85xx_qe_init(void)
                return;
        }
 
-       qe_reset();
        of_node_put(np);
 
 }
index c2518cd..88ae5c7 100644 (file)
@@ -671,6 +671,19 @@ unsigned int qe_get_num_of_snums(void)
 }
 EXPORT_SYMBOL(qe_get_num_of_snums);
 
+static int __init qe_init(void)
+{
+       struct device_node *np;
+
+       np = of_find_compatible_node(NULL, NULL, "fsl,qe");
+       if (!np)
+               return -ENODEV;
+       qe_reset();
+       of_node_put(np);
+       return 0;
+}
+subsys_initcall(qe_init);
+
 #if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC_85xx)
 static int qe_resume(struct platform_device *ofdev)
 {