Linux Power Management development
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Viresh Kumar <viresh.kumar@linaro.org>,
	Kelvin Cheung <keguang.zhang@gmail.com>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH V3 6/6] cpufreq: Loongson1: Add cpufreq driver for Loongson1B
Date: Sat, 08 Nov 2014 02:40 +0100	[thread overview]
Message-ID: <15391417.y1hO0MjdpJ@vostro.rjw.lan> (raw)
In-Reply-To: <CAKohponU38r6V_VvGz0bd_nXsNeZQy5=KYK2UGKAQxpey7q9cg@mail.gmail.com>

On Friday, October 17, 2014 04:07:50 PM Viresh Kumar wrote:
> 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>

Patch queued up for 3.19-rc1, thanks!


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

      reply	other threads:[~2014-11-08  1:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-17 10:23 [PATCH V3 6/6] cpufreq: Loongson1: Add cpufreq driver for Loongson1B Kelvin Cheung
2014-10-17 10:37 ` Viresh Kumar
2014-11-08  1:40   ` Rafael J. Wysocki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15391417.y1hO0MjdpJ@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=keguang.zhang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox