From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Bai Ping <b51503@freescale.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] cpufreq: imx: update the clock switch flow to support imx6ul
Date: Mon, 05 Oct 2015 22:49:32 +0200 [thread overview]
Message-ID: <40126314.fXMZovt841@vostro.rjw.lan> (raw)
In-Reply-To: <55F292ED.1080000@freescale.com>
On Friday, September 11, 2015 04:38:05 PM Bai Ping wrote:
>
> On 2015/9/11 16:07, Viresh Kumar wrote:
> > On 11-09-15, 23:41, Bai Ping wrote:
> >> + if (of_machine_is_compatible("fsl,imx6ul")) {
> >> + pll2_bus_clk = clk_get(cpu_dev, "pll2_bus");
> >> + secondary_sel_clk = clk_get(cpu_dev, "secondary_sel");
> >> + if (IS_ERR(pll2_bus_clk) || IS_ERR(secondary_sel_clk)) {
> >> + dev_err(cpu_dev, "failed to get clocks specific to imx6ul\n");
> >> + ret = -ENOENT;
> >> + goto put_clk;
> >> + }
> >> + }
> >> +
> >> arm_reg = regulator_get(cpu_dev, "arm");
> >> pu_reg = regulator_get_optional(cpu_dev, "pu");
> >> soc_reg = regulator_get(cpu_dev, "soc");
> >> @@ -331,6 +365,10 @@ put_clk:
> >> clk_put(step_clk);
> >> if (!IS_ERR(pll2_pfd2_396m_clk))
> >> clk_put(pll2_pfd2_396m_clk);
> >> + if (!IS_ERR(pll2_bus_clk))
> >> + clk_put(pll2_bus_clk);
> >> + if (!IS_ERR(secondary_sel_clk))
> >> + clk_put(secondary_sel_clk);
> >> of_node_put(np);
> >> return ret;
> >> }
> > As part of good coding practices, you should free resources in the
> > reverse order to which they were allocated. The clocks don't follow
> > that, but its not a problem with just your patch. That's how it is
> > present today. Maybe you can write another patch to fix that.
>
> thanks for your suggestion, I will pay more attention to it in future
> coding.
>
> > Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Patch applied, thanks!
Rafael
prev parent reply other threads:[~2015-10-05 20:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 15:41 [PATCH v2] cpufreq: imx: update the clock switch flow to support imx6ul Bai Ping
2015-09-11 8:07 ` Viresh Kumar
2015-09-11 8:38 ` Bai Ping
2015-10-05 20:49 ` 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=40126314.fXMZovt841@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=b51503@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.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