* [PATCH v2] clk: qcom: Fix error checking for devm_clk_hw_get_clk()
@ 2024-08-26 6:17 Yan Zhen
2024-08-26 13:00 ` Markus Elfring
2024-08-29 9:02 ` Dmitry Baryshkov
0 siblings, 2 replies; 3+ messages in thread
From: Yan Zhen @ 2024-08-26 6:17 UTC (permalink / raw)
To: mturquette, sboyd, andersson
Cc: linux-arm-msm, linux-clk, linux-kernel, opensoure.kernel, Yan Zhen
The devm_clk_hw_get_clk() function returns error pointers.
It never returns NULL. Update the check accordingly.
Signed-off-by: Yan Zhen <yanzhen@vivo.com>
---
Changes in v2:
- Return PTR_ERR(icd[i].clk) instead of -ENOENT.
drivers/clk/qcom/common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
index 33cc1f73c69d..5a9e653916ea 100644
--- a/drivers/clk/qcom/common.c
+++ b/drivers/clk/qcom/common.c
@@ -273,8 +273,8 @@ static int qcom_cc_icc_register(struct device *dev,
icd[i].slave_id = desc->icc_hws[i].slave_id;
hws = &desc->clks[desc->icc_hws[i].clk_id]->hw;
icd[i].clk = devm_clk_hw_get_clk(dev, hws, "icc");
- if (!icd[i].clk)
- return dev_err_probe(dev, -ENOENT,
+ if (IS_ERR(icd[i].clk))
+ return dev_err_probe(dev, PTR_ERR(icd[i].clk),
"(%d) clock entry is null\n", i);
icd[i].name = clk_hw_get_name(hws);
}
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] clk: qcom: Fix error checking for devm_clk_hw_get_clk()
2024-08-26 6:17 [PATCH v2] clk: qcom: Fix error checking for devm_clk_hw_get_clk() Yan Zhen
@ 2024-08-26 13:00 ` Markus Elfring
2024-08-29 9:02 ` Dmitry Baryshkov
1 sibling, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2024-08-26 13:00 UTC (permalink / raw)
To: Yan Zhen, linux-clk, linux-arm-msm, opensoure.kernel,
Bjorn Andersson, Michael Turquette, Stephen Boyd
Cc: LKML
> The devm_clk_hw_get_clk() function returns error pointers.
> It never returns NULL. Update the check accordingly.
Would you like to add any tags (like “Fixes” and “Cc”)?
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] clk: qcom: Fix error checking for devm_clk_hw_get_clk()
2024-08-26 6:17 [PATCH v2] clk: qcom: Fix error checking for devm_clk_hw_get_clk() Yan Zhen
2024-08-26 13:00 ` Markus Elfring
@ 2024-08-29 9:02 ` Dmitry Baryshkov
1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Baryshkov @ 2024-08-29 9:02 UTC (permalink / raw)
To: Yan Zhen
Cc: mturquette, sboyd, andersson, linux-arm-msm, linux-clk,
linux-kernel, opensoure.kernel
On Mon, Aug 26, 2024 at 02:17:17PM GMT, Yan Zhen wrote:
> The devm_clk_hw_get_clk() function returns error pointers.
> It never returns NULL. Update the check accordingly.
>
>
> Signed-off-by: Yan Zhen <yanzhen@vivo.com>
> ---
>
> Changes in v2:
> - Return PTR_ERR(icd[i].clk) instead of -ENOENT.
>
Fixes: 8737ec830ee3 ("clk: qcom: common: Add interconnect clocks support")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-08-29 9:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-26 6:17 [PATCH v2] clk: qcom: Fix error checking for devm_clk_hw_get_clk() Yan Zhen
2024-08-26 13:00 ` Markus Elfring
2024-08-29 9:02 ` Dmitry Baryshkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®