Re: [PATCH 3/3] clk: Replace of_clk_get_by_clkspec() with of_clk_get_from_provider()

From: Tomeu Vizoso
Date: Fri Feb 06 2015 - 06:43:17 EST


On 02/06/2015 01:19 AM, Stephen Boyd wrote:
> of_clk_get_by_clkspec() has the same function signature as
> of_clk_get_from_provider()
>
> struct clk *of_clk_get_by_clkspec(struct of_phandle_args
> *clkspec)
> struct clk *of_clk_get_from_provider(struct of_phandle_args
> *clkspec)
>
> except of_clk_get_by_clkspec() checks to make sure clkspec is not
> NULL. Let's remove of_clk_get_by_clkspec() and replace the
> callers of it (clkconf.c) with of_clk_get_from_provider().
>
> Cc: Sylwester Nawrocki <s.nawrocki@xxxxxxxxxxx>
> Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxxxxxx>
> ---
> drivers/clk/clk-conf.c | 6 +++---
> drivers/clk/clk.c | 31 ++++++++++++++-----------------
> drivers/clk/clk.h | 3 ---
> drivers/clk/clkdev.c | 30 +-----------------------------
> 4 files changed, 18 insertions(+), 52 deletions(-)
>
> diff --git a/drivers/clk/clk-conf.c b/drivers/clk/clk-conf.c
> index aad4796aa3ed..6a681a2c4c89 100644
> --- a/drivers/clk/clk-conf.c
> +++ b/drivers/clk/clk-conf.c
> @@ -39,7 +39,7 @@ static int __set_clk_parents(struct device_node *node, bool clk_supplier)
> }
> if (clkspec.np == node && !clk_supplier)
> return 0;
> - pclk = of_clk_get_by_clkspec(&clkspec);
> + pclk = of_clk_get_from_provider(&clkspec);
> if (IS_ERR(pclk)) {
> pr_warn("clk: couldn't get parent clock %d for %s\n",
> index, node->full_name);
> @@ -54,7 +54,7 @@ static int __set_clk_parents(struct device_node *node, bool clk_supplier)
> rc = 0;
> goto err;
> }
> - clk = of_clk_get_by_clkspec(&clkspec);
> + clk = of_clk_get_from_provider(&clkspec);
> if (IS_ERR(clk)) {
> pr_warn("clk: couldn't get parent clock %d for %s\n",
> index, node->full_name);
> @@ -98,7 +98,7 @@ static int __set_clk_rates(struct device_node *node, bool clk_supplier)
> if (clkspec.np == node && !clk_supplier)
> return 0;
>
> - clk = of_clk_get_by_clkspec(&clkspec);
> + clk = of_clk_get_from_provider(&clkspec);
> if (IS_ERR(clk)) {
> pr_warn("clk: couldn't get clock %d for %s\n",
> index, node->full_name);
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 315dc22b7356..5d804a43ab1a 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -2807,16 +2807,6 @@ static LIST_HEAD(of_clk_providers);
> static DEFINE_MUTEX(of_clk_mutex);
>
> /* of_clk_provider list locking helpers */

Patch looks good to me, but this comment can be removed now.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@xxxxxxxxxxxxx>

Thanks,

Tomeu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/