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


Groups > linux.kernel > #1514952 > unrolled thread

[PATCH v2 3/3] firmware: qcom: scm: Return PTR_ERR when devm_clk_get fails

Started bySarangdhar Joshi <spjoshi@codeaurora.org>
First post2016-11-04 01:20 +0100
Last post2016-11-10 02:50 +0100
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

  [PATCH v2 3/3] firmware: qcom: scm: Return PTR_ERR when devm_clk_get fails Sarangdhar Joshi <spjoshi@codeaurora.org> - 2016-11-04 01:20 +0100
    Re: [PATCH v2 3/3] firmware: qcom: scm: Return PTR_ERR when  devm_clk_get fails Stephen Boyd <sboyd@codeaurora.org> - 2016-11-10 02:50 +0100

#1514952 — [PATCH v2 3/3] firmware: qcom: scm: Return PTR_ERR when devm_clk_get fails

FromSarangdhar Joshi <spjoshi@codeaurora.org>
Date2016-11-04 01:20 +0100
Subject[PATCH v2 3/3] firmware: qcom: scm: Return PTR_ERR when devm_clk_get fails
Message-ID<szAoG-2F9-15@gated-at.bofh.it>
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(-)

diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
index 844e90d..0321a26 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

[toc] | [next] | [standalone]


#1518635 — Re: [PATCH v2 3/3] firmware: qcom: scm: Return PTR_ERR when devm_clk_get fails

FromStephen Boyd <sboyd@codeaurora.org>
Date2016-11-10 02:50 +0100
SubjectRe: [PATCH v2 3/3] firmware: qcom: scm: Return PTR_ERR when devm_clk_get fails
Message-ID<sBMF3-7dD-15@gated-at.bofh.it>
In reply to#1514952
On 11/03, 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>

Why can't this be folded into the second patch? It seems
incorrect to allow it to silently work in patch 2 even though
we've flagged that clk as a requirement and then change that
behavior here.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web