Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1222603 > unrolled thread

Re: [PATCH v2] cpufreq: imx: update the clock switch flow to support imx6ul

Started byViresh Kumar <viresh.kumar@linaro.org>
First post2015-09-11 10:10 +0200
Last post2015-09-11 10:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2] cpufreq: imx: update the clock switch flow to support  imx6ul Viresh Kumar <viresh.kumar@linaro.org> - 2015-09-11 10:10 +0200
    Re: [PATCH v2] cpufreq: imx: update the clock switch flow to support  imx6ul Bai Ping <b51503@freescale.com> - 2015-09-11 10:40 +0200

#1222603 — Re: [PATCH v2] cpufreq: imx: update the clock switch flow to support imx6ul

FromViresh Kumar <viresh.kumar@linaro.org>
Date2015-09-11 10:10 +0200
SubjectRe: [PATCH v2] cpufreq: imx: update the clock switch flow to support imx6ul
Message-ID<q7rzc-49f-31@gated-at.bofh.it>
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.

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

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

[toc] | [next] | [standalone]


#1222623

FromBai Ping <b51503@freescale.com>
Date2015-09-11 10:40 +0200
Message-ID<q7s2e-4Hu-23@gated-at.bofh.it>
In reply to#1222603

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>
>

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web