diff mbox

[v3,3/3] firmware: qcom: scm: Return PTR_ERR when devm_clk_get fails

Message ID 1479259165-1601-4-git-send-email-spjoshi@codeaurora.org (mailing list archive)
State Accepted, archived
Delegated to: Andy Gross
Headers show

Commit Message

Sarangdhar Joshi Nov. 16, 2016, 1:19 a.m. UTC
When devm_clk_get fails for core clock, the failure was ignored
and the core_clk was explicitly set to NULL so that other
remaining clocks can be queried. However, now that we have a
cleaner way of expressing the clock dependency, return failure
when devm_clk_get fails for core clock.

Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
---
 drivers/firmware/qcom_scm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Stephen Boyd Nov. 17, 2016, 11:13 p.m. UTC | #1
On 11/15, Sarangdhar Joshi wrote:
> When devm_clk_get fails for core clock, the failure was ignored
> and the core_clk was explicitly set to NULL so that other
> remaining clocks can be queried. However, now that we have a
> cleaner way of expressing the clock dependency, return failure
> when devm_clk_get fails for core clock.
> 
> Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
> ---

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Bjorn Andersson Nov. 18, 2016, 7:59 p.m. UTC | #2
On Tue 15 Nov 17:19 PST 2016, Sarangdhar Joshi wrote:

> When devm_clk_get fails for core clock, the failure was ignored
> and the core_clk was explicitly set to NULL so that other
> remaining clocks can be queried. However, now that we have a
> cleaner way of expressing the clock dependency, return failure
> when devm_clk_get fails for core clock.
> 
> Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>

Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  drivers/firmware/qcom_scm.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
> index ddf7c8b..0fbf2ea 100644
> --- a/drivers/firmware/qcom_scm.c
> +++ b/drivers/firmware/qcom_scm.c
> @@ -395,10 +395,10 @@ static int qcom_scm_probe(struct platform_device *pdev)
>  	if (clks & SCM_HAS_CORE_CLK) {
>  		scm->core_clk = devm_clk_get(&pdev->dev, "core");
>  		if (IS_ERR(scm->core_clk)) {
> -			if (PTR_ERR(scm->core_clk) == -EPROBE_DEFER)
> -				return PTR_ERR(scm->core_clk);
> -
> -			scm->core_clk = NULL;
> +			if (PTR_ERR(scm->core_clk) != -EPROBE_DEFER)
> +				dev_err(&pdev->dev,
> +					"failed to acquire core clk\n");
> +			return PTR_ERR(scm->core_clk);
>  		}
>  	}
>  
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
index ddf7c8b..0fbf2ea 100644
--- a/drivers/firmware/qcom_scm.c
+++ b/drivers/firmware/qcom_scm.c
@@ -395,10 +395,10 @@  static int qcom_scm_probe(struct platform_device *pdev)
 	if (clks & SCM_HAS_CORE_CLK) {
 		scm->core_clk = devm_clk_get(&pdev->dev, "core");
 		if (IS_ERR(scm->core_clk)) {
-			if (PTR_ERR(scm->core_clk) == -EPROBE_DEFER)
-				return PTR_ERR(scm->core_clk);
-
-			scm->core_clk = NULL;
+			if (PTR_ERR(scm->core_clk) != -EPROBE_DEFER)
+				dev_err(&pdev->dev,
+					"failed to acquire core clk\n");
+			return PTR_ERR(scm->core_clk);
 		}
 	}