[PATCH v12 5/6] QE: use subsys_initcall to init qe

Scott Wood scottwood at freescale.com
Fri Oct 23 14:11:21 AEDT 2015


On Wed, 2015-10-14 at 15:16 +0800, Zhao Qiang wrote:
> diff --git a/arch/powerpc/sysdev/qe_lib/qe.c > b/arch/powerpc/sysdev/qe_lib/qe.c
> index c2518cd..3f9f596 100644
> --- a/arch/powerpc/sysdev/qe_lib/qe.c
> +++ b/arch/powerpc/sysdev/qe_lib/qe.c
> @@ -671,6 +671,21 @@ 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) {
> +             pr_err("%s: Could not find Quicc Engine node\n", __func__);
> +             return -ENODEV;
> +     }
> +     qe_reset();
> +     of_node_put(np);
> +     return 0;
> +}
> +subsys_initcall(qe_init);

Do not print an error, just because QE is not present.

-Scott



More information about the Linuxppc-dev mailing list