Skip to contentSkip to conversation

clk: qcom: common: Fix NULL vs IS_ERR() check in qcom_cc_icc_register()

PATCH Applied Dan Carpenter 4 participants 4 messages Sep 2, 2025 – Sep 4, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: qcom: common: Fix NULL vs IS_ERR() check in qcom_cc_icc_register()

The devm_clk_hw_get_clk() function doesn't return NULL, it returns error pointers. Update the checking to match.

Fixes 8737ec830ee3 ("clk: qcom: common: Add interconnect clocks support")
---
 drivers/clk/qcom/common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/common.c +2 -2
index 37c3008e6c1b..121591886774 100644
@@ -277,8 +277,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);
 	}
Signature · 1 line
2.47.2
Reviewed-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter
Quoted 9 lines · Dan Carpenter

The devm_clk_hw_get_clk() function doesn't return NULL, it returns error pointers. Update the checking to match.

Fixes 8737ec830ee3 ("clk: qcom: common: Add interconnect clocks support")
---
 drivers/clk/qcom/common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Thanks,
Imran

maintainer Applied
#3 lore raw
In reply to Dan Carpenter
Quoted 4 lines · Dan Carpenter

The devm_clk_hw_get_clk() function doesn't return NULL, it returns error pointers. Update the checking to match.

Applied, thanks!

[1/1] clk: qcom: common: Fix NULL vs IS_ERR() check in qcom_cc_icc_register()

      commit: 1e50f5c9965252ed6657b8692cd7366784d60616

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>