lkml.org 
[lkml]   [2014]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V3 6/6] cpufreq: Loongson1: Add cpufreq driver for Loongson1B
From
On 17 October 2014 15:53, Kelvin Cheung <keguang.zhang@gmail.com> wrote:
> This patch adds cpufreq driver for Loongson1B which
> is capable of changing the CPU frequency dynamically.
>
> Signed-off-by: Kelvin Cheung <keguang.zhang@gmail.com>
>
> ---
> V3:
> Remove superfluous devm_clk_put().

Sorry for being bad to you :)

> +static int ls1x_cpufreq_probe(struct platform_device *pdev)
> +{
> + struct plat_ls1x_cpufreq *pdata = pdev->dev.platform_data;
> + struct clk *clk;
> + int ret;
> +
> + if (!pdata || !pdata->clk_name || !pdata->osc_clk_name)
> + return -EINVAL;
> +
> + ls1x_cpufreq.dev = &pdev->dev;
> +
> + clk = devm_clk_get(&pdev->dev, pdata->clk_name);
> + if (IS_ERR(clk)) {
> + dev_err(ls1x_cpufreq.dev, "unable to get %s clock\n",
> + pdata->clk_name);
> + ret = PTR_ERR(clk);
> + goto out;
> + }
> + ls1x_cpufreq.clk = clk;
> +
> + clk = clk_get_parent(clk);
> + if (IS_ERR(clk)) {
> + dev_err(ls1x_cpufreq.dev, "unable to get parent of %s clock\n",
> + __clk_get_name(ls1x_cpufreq.clk));
> + ret = PTR_ERR(clk);
> + goto out;
> + }
> + ls1x_cpufreq.mux_clk = clk;
> +
> + clk = clk_get_parent(clk);
> + if (IS_ERR(clk)) {
> + dev_err(ls1x_cpufreq.dev, "unable to get parent of %s clock\n",
> + __clk_get_name(ls1x_cpufreq.mux_clk));
> + ret = PTR_ERR(clk);
> + goto out;
> + }
> + ls1x_cpufreq.pll_clk = clk;
> +
> + clk = devm_clk_get(&pdev->dev, pdata->osc_clk_name);
> + if (IS_ERR(clk)) {
> + dev_err(ls1x_cpufreq.dev, "unable to get %s clock\n",
> + pdata->osc_clk_name);
> + ret = PTR_ERR(clk);
> + goto out;
> + }
> + ls1x_cpufreq.osc_clk = clk;
> +
> + ls1x_cpufreq.max_freq = pdata->max_freq;
> + ls1x_cpufreq.min_freq = pdata->min_freq;
> +
> + ret = cpufreq_register_driver(&ls1x_cpufreq_driver);
> + if (ret) {
> + dev_err(ls1x_cpufreq.dev,
> + "failed to register cpufreq driver: %d\n", ret);
> + goto out;
> + }
> +
> + ret = cpufreq_register_notifier(&ls1x_cpufreq_notifier_block,
> + CPUFREQ_TRANSITION_NOTIFIER);
> +
> + if (!ret)
> + goto out;
> +
> + dev_err(ls1x_cpufreq.dev, "failed to register cpufreq notifier: %d\n",
> + ret);
> +
> + cpufreq_unregister_driver(&ls1x_cpufreq_driver);
> +out:

But all these goto out; doesn't make sense anymore. Just issue returns
from all places and add

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>


\
 
 \ /
  Last update: 2014-10-17 13:01    [W:1.033 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site