[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190625203941.15C94205ED@mail.kernel.org>
Date: Tue, 25 Jun 2019 13:39:40 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: Abel Vesa <abel.vesa@....com>, Anson Huang <anson.huang@....com>,
Fabio Estevam <fabio.estevam@....com>,
Jacky Bai <ping.bai@....com>,
Mike Turquette <mturquette@...libre.com>,
Sascha Hauer <kernel@...gutronix.de>,
Shawn Guo <shawnguo@...nel.org>
Cc: NXP Linux Team <linux-imx@....com>, linux-clk@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Abel Vesa <abel.vesa@....com>
Subject: Re: [PATCH] clk: imx8mm: Switch to platform driver
Quoting Abel Vesa (2019-06-24 03:54:32)
> In order to make the clock provider a platform driver
> all the data and code needs to be outside of .init section.
Yes, but why are you making this change in general?
>
> Signed-off-by: Abel Vesa <abel.vesa@....com>
[...]
> @@ -480,7 +481,7 @@ static int __init imx8mm_clocks_init(struct device_node *ccm_node)
> clks[IMX8MM_SYS_PLL2_500M] = imx_clk_fixed_factor("sys_pll2_500m", "sys_pll2_out", 1, 2);
> clks[IMX8MM_SYS_PLL2_1000M] = imx_clk_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1);
>
> - np = ccm_node;
> + np = dev->of_node;
> base = of_iomap(np, 0);
If we're using platform device here it would be nice to also use
platform device APIs to map memory and request resources, etc.
> if (WARN_ON(!base))
> return -ENOMEM;
> @@ -682,4 +683,19 @@ static int __init imx8mm_clocks_init(struct device_node *ccm_node)
>
> return 0;
> }
> -CLK_OF_DECLARE_DRIVER(imx8mm, "fsl,imx8mm-ccm", imx8mm_clocks_init);
> +
> +static const struct of_device_id imx8mm_clk_of_match[] = {
> + { .compatible = "fsl,imx8mm-ccm" },
> + { /* Sentinel */ },
> +};
> +MODULE_DEVICE_TABLE(of, imx8mm_clk_of_match);
> +
> +
Nitpick: Drop the second newline.
> +static struct platform_driver imx8mm_clk_driver = {
> + .probe = imx8mm_clocks_probe,
> + .driver = {
> + .name = "imx8mm-ccm",
> + .of_match_table = of_match_ptr(imx8mm_clk_of_match),
> + },
> +};
> +module_platform_driver(imx8mm_clk_driver);
Powered by blists - more mailing lists