* [PATCH] clk: qcom: Return correct error code in qcom_cc_probe_by_index()
@ 2025-12-17 4:13 Haotian Zhang
2025-12-17 10:04 ` Konrad Dybcio
2026-01-05 14:07 ` Bjorn Andersson
0 siblings, 2 replies; 3+ messages in thread
From: Haotian Zhang @ 2025-12-17 4:13 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd
Cc: linux-arm-msm, linux-clk, linux-kernel, Haotian Zhang
When devm_platform_ioremap_resource() fails, it returns various
error codes. Returning a hardcoded -ENOMEM masks the actual
failure reason.
Use PTR_ERR() to propagate the actual error code returned by
devm_platform_ioremap_resource() instead of -ENOMEM.
Fixes: 75e0a1e30191 ("clk: qcom: define probe by index API as common API")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
---
drivers/clk/qcom/common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
index 121591886774..eec369d2173b 100644
--- a/drivers/clk/qcom/common.c
+++ b/drivers/clk/qcom/common.c
@@ -454,7 +454,7 @@ int qcom_cc_probe_by_index(struct platform_device *pdev, int index,
base = devm_platform_ioremap_resource(pdev, index);
if (IS_ERR(base))
- return -ENOMEM;
+ return PTR_ERR(base);
regmap = devm_regmap_init_mmio(&pdev->dev, base, desc->config);
if (IS_ERR(regmap))
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: qcom: Return correct error code in qcom_cc_probe_by_index()
2025-12-17 4:13 [PATCH] clk: qcom: Return correct error code in qcom_cc_probe_by_index() Haotian Zhang
@ 2025-12-17 10:04 ` Konrad Dybcio
2026-01-05 14:07 ` Bjorn Andersson
1 sibling, 0 replies; 3+ messages in thread
From: Konrad Dybcio @ 2025-12-17 10:04 UTC (permalink / raw)
To: Haotian Zhang, Bjorn Andersson, Michael Turquette, Stephen Boyd
Cc: linux-arm-msm, linux-clk, linux-kernel
On 12/17/25 5:13 AM, Haotian Zhang wrote:
> When devm_platform_ioremap_resource() fails, it returns various
> error codes. Returning a hardcoded -ENOMEM masks the actual
> failure reason.
>
> Use PTR_ERR() to propagate the actual error code returned by
> devm_platform_ioremap_resource() instead of -ENOMEM.
>
> Fixes: 75e0a1e30191 ("clk: qcom: define probe by index API as common API")
> Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
> ---
> drivers/clk/qcom/common.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
> index 121591886774..eec369d2173b 100644
> --- a/drivers/clk/qcom/common.c
> +++ b/drivers/clk/qcom/common.c
> @@ -454,7 +454,7 @@ int qcom_cc_probe_by_index(struct platform_device *pdev, int index,
>
> base = devm_platform_ioremap_resource(pdev, index);
> if (IS_ERR(base))
> - return -ENOMEM;
> + return PTR_ERR(base);
Nice find!
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: qcom: Return correct error code in qcom_cc_probe_by_index()
2025-12-17 4:13 [PATCH] clk: qcom: Return correct error code in qcom_cc_probe_by_index() Haotian Zhang
2025-12-17 10:04 ` Konrad Dybcio
@ 2026-01-05 14:07 ` Bjorn Andersson
1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2026-01-05 14:07 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Haotian Zhang
Cc: linux-arm-msm, linux-clk, linux-kernel
On Wed, 17 Dec 2025 12:13:38 +0800, Haotian Zhang wrote:
> When devm_platform_ioremap_resource() fails, it returns various
> error codes. Returning a hardcoded -ENOMEM masks the actual
> failure reason.
>
> Use PTR_ERR() to propagate the actual error code returned by
> devm_platform_ioremap_resource() instead of -ENOMEM.
>
> [...]
Applied, thanks!
[1/1] clk: qcom: Return correct error code in qcom_cc_probe_by_index()
commit: 1e07ebe744fb522983bd52a4a6148601675330c7
Best regards,
--
Bjorn Andersson <andersson@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-05 14:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-17 4:13 [PATCH] clk: qcom: Return correct error code in qcom_cc_probe_by_index() Haotian Zhang
2025-12-17 10:04 ` Konrad Dybcio
2026-01-05 14:07 ` Bjorn Andersson
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®