[-next] cpufreq: scpi: fix error return code in scpi_cpufreq_init()
diff mbox

Message ID 1516673342-170261-1-git-send-email-weiyongjun1@huawei.com
State Mainlined
Delegated to: Rafael Wysocki
Headers show

Commit Message

Wei Yongjun Jan. 23, 2018, 2:09 a.m. UTC
Fix to return a negative error code from the clk_get() error handling
case instead of 0, as done elsewhere in this function.

Fixes: 343a8d17fa8d ("cpufreq: scpi: remove arm_big_little dependency")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/cpufreq/scpi-cpufreq.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Viresh Kumar Jan. 23, 2018, 3:15 a.m. UTC | #1
On 23-01-18, 02:09, Wei Yongjun wrote:
> Fix to return a negative error code from the clk_get() error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: 343a8d17fa8d ("cpufreq: scpi: remove arm_big_little dependency")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/cpufreq/scpi-cpufreq.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c
> index 247fcbf..7095fc0 100644
> --- a/drivers/cpufreq/scpi-cpufreq.c
> +++ b/drivers/cpufreq/scpi-cpufreq.c
> @@ -145,6 +145,7 @@ static int scpi_cpufreq_init(struct cpufreq_policy *policy)
>  	if (IS_ERR(priv->clk)) {
>  		dev_err(cpu_dev, "%s: Failed to get clk for cpu: %d\n",
>  			__func__, cpu_dev->id);
> +		ret = PTR_ERR(priv->clk);
>  		goto out_free_cpufreq_table;
>  	}

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Sudeep Holla Jan. 23, 2018, 10:14 a.m. UTC | #2
On 23/01/18 02:09, Wei Yongjun wrote:
> Fix to return a negative error code from the clk_get() error handling
> case instead of 0, as done elsewhere in this function.
> 

Thanks for catching this.

Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Rafael J. Wysocki Feb. 8, 2018, 10:05 a.m. UTC | #3
On Tuesday, January 23, 2018 11:14:41 AM CET Sudeep Holla wrote:
> 
> On 23/01/18 02:09, Wei Yongjun wrote:
> > Fix to return a negative error code from the clk_get() error handling
> > case instead of 0, as done elsewhere in this function.
> > 
> 
> Thanks for catching this.
> 
> Acked-by: Sudeep Holla <sudeep.holla@arm.com>

Patch applied, thanks!

Patch
diff mbox

diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c
index 247fcbf..7095fc0 100644
--- a/drivers/cpufreq/scpi-cpufreq.c
+++ b/drivers/cpufreq/scpi-cpufreq.c
@@ -145,6 +145,7 @@  static int scpi_cpufreq_init(struct cpufreq_policy *policy)
 	if (IS_ERR(priv->clk)) {
 		dev_err(cpu_dev, "%s: Failed to get clk for cpu: %d\n",
 			__func__, cpu_dev->id);
+		ret = PTR_ERR(priv->clk);
 		goto out_free_cpufreq_table;
 	}