public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Bai Ping <b51503@freescale.com>
Cc: rjw@rjwysocki.net, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq: imx: use the managed interfaces for resources allocation
Date: Mon, 31 Aug 2015 14:36:16 +0530	[thread overview]
Message-ID: <20150831090616.GC5215@linux> (raw)
In-Reply-To: <1441040730-16391-1-git-send-email-b51503@freescale.com>

On 01-09-15, 01:05, Bai Ping wrote:
> Replace the clk_get() and regulator_get() with the managed interfaces
> then the error path can be simplified.
> 
> Signed-off-by: Bai Ping <b51503@freescale.com>
> ---
>  drivers/cpufreq/imx6q-cpufreq.c | 52 +++++++++++------------------------------
>  1 file changed, 13 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
> index 380a90d..1439f93 100644
> --- a/drivers/cpufreq/imx6q-cpufreq.c
> +++ b/drivers/cpufreq/imx6q-cpufreq.c
> @@ -174,25 +174,25 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
>  		return -ENOENT;
>  	}
>  
> -	arm_clk = clk_get(cpu_dev, "arm");
> -	pll1_sys_clk = clk_get(cpu_dev, "pll1_sys");
> -	pll1_sw_clk = clk_get(cpu_dev, "pll1_sw");
> -	step_clk = clk_get(cpu_dev, "step");
> -	pll2_pfd2_396m_clk = clk_get(cpu_dev, "pll2_pfd2_396m");
> +	arm_clk = devm_clk_get(cpu_dev, "arm");

Because the driver is getting attached to pdev (or pdev->dev), these
resources will not be freed eventually as what you are binding them to
is cpu_dev.

So, this patch is completely wrong.

-- 
viresh

  reply	other threads:[~2015-08-31  9:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-31 17:05 [PATCH] cpufreq: imx: use the managed interfaces for resources allocation Bai Ping
2015-08-31  9:06 ` Viresh Kumar [this message]
2015-08-31 11:06 ` Lucas Stach

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=20150831090616.GC5215@linux \
    --to=viresh.kumar@linaro.org \
    --cc=b51503@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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