Re: [PATCH 1/3] clk: imx: Declare clock init functions in header acessible from mach
From: Shawn Guo
Date: Sat Sep 05 2020 - 03:47:05 EST
On Wed, Sep 02, 2020 at 05:02:42PM +0200, Krzysztof Kozlowski wrote:
> Multiple files from arch/arm/mach-imx/ use clock init functions which
> are defined in the IMX clock drivers. Declare them in globally
> accessible header to fix GCC warnings:
>
> drivers/clk/imx/clk-imx21.c:122:74: warning: no previous prototype for 'mx21_clocks_init' [-Wmissing-prototypes]
>
> Signed-off-by: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
Fabio is working on converting these platforms to DT only, so we will be
able to use CLK_OF_DECLARE() for calling these clock init functions
soon.
Shawn
> ---
> drivers/clk/imx/clk-imx21.c | 1 +
> drivers/clk/imx/clk-imx27.c | 1 +
> drivers/clk/imx/clk-imx31.c | 1 +
> drivers/clk/imx/clk-imx35.c | 1 +
> include/linux/clk/imx.h | 11 +++++++++++
> 5 files changed, 15 insertions(+)
> create mode 100644 include/linux/clk/imx.h
>
> diff --git a/drivers/clk/imx/clk-imx21.c b/drivers/clk/imx/clk-imx21.c
> index 077b4a7123ce..2105ef57b6bc 100644
> --- a/drivers/clk/imx/clk-imx21.c
> +++ b/drivers/clk/imx/clk-imx21.c
> @@ -7,6 +7,7 @@
>
> #include <linux/clk-provider.h>
> #include <linux/clkdev.h>
> +#include <linux/clk/imx.h>
> #include <linux/io.h>
> #include <linux/of.h>
> #include <linux/of_address.h>
> diff --git a/drivers/clk/imx/clk-imx27.c b/drivers/clk/imx/clk-imx27.c
> index a3753067fc12..c0d8bcdf0719 100644
> --- a/drivers/clk/imx/clk-imx27.c
> +++ b/drivers/clk/imx/clk-imx27.c
> @@ -2,6 +2,7 @@
> #include <linux/clk.h>
> #include <linux/clk-provider.h>
> #include <linux/clkdev.h>
> +#include <linux/clk/imx.h>
> #include <linux/err.h>
> #include <linux/io.h>
> #include <linux/of.h>
> diff --git a/drivers/clk/imx/clk-imx31.c b/drivers/clk/imx/clk-imx31.c
> index 4bb05e440cdd..25be4c292e44 100644
> --- a/drivers/clk/imx/clk-imx31.c
> +++ b/drivers/clk/imx/clk-imx31.c
> @@ -6,6 +6,7 @@
> #include <linux/module.h>
> #include <linux/clk.h>
> #include <linux/clkdev.h>
> +#include <linux/clk/imx.h>
> #include <linux/io.h>
> #include <linux/err.h>
> #include <linux/of.h>
> diff --git a/drivers/clk/imx/clk-imx35.c b/drivers/clk/imx/clk-imx35.c
> index e595f559907f..baf8d236d6ef 100644
> --- a/drivers/clk/imx/clk-imx35.c
> +++ b/drivers/clk/imx/clk-imx35.c
> @@ -5,6 +5,7 @@
> #include <linux/mm.h>
> #include <linux/delay.h>
> #include <linux/clk.h>
> +#include <linux/clk/imx.h>
> #include <linux/io.h>
> #include <linux/clkdev.h>
> #include <linux/of.h>
> diff --git a/include/linux/clk/imx.h b/include/linux/clk/imx.h
> new file mode 100644
> index 000000000000..f6394d1b0a94
> --- /dev/null
> +++ b/include/linux/clk/imx.h
> @@ -0,0 +1,11 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +#ifndef __LINUX_CLK_IMX_H
> +#define __LINUX_CLK_IMX_H
> +
> +int mx21_clocks_init(unsigned long lref, unsigned long href);
> +int mx27_clocks_init(unsigned long fref);
> +int mx31_clocks_init(unsigned long fref);
> +int mx35_clocks_init(void);
> +
> +#endif /* __LINUX_CLK_IMX_H */
> --
> 2.17.1
>