Skip to contentSkip to conversation

clk: qcom: Fix return value check in apss_ipq6018_probe()

PATCH Applied Wei Yongjun 2 participants 2 messages Jun 28, 2020 – Jun 29, 2020

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

PATCH 1/1 clk: qcom: Fix return value check in apss_ipq6018_probe()

In case of error, the function dev_get_regmap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test.

Fixes 5e77b4ef1b19 ("clk: qcom: Add ipq6018 apss clock controller")
---
 drivers/clk/qcom/apss-ipq6018.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/apss-ipq6018.c +2 -2
index 004f7e1ecdc2..d78ff2f310bf 100644
@@ -87,8 +87,8 @@ static int apss_ipq6018_probe(struct platform_device *pdev)
 	struct regmap *regmap;
 
 	regmap = dev_get_regmap(pdev->dev.parent, NULL);
-	if (IS_ERR(regmap))
-		return PTR_ERR(regmap);
+	if (!regmap)
+		return -ENODEV;
 
 	return qcom_cc_really_probe(pdev, &apss_ipq6018_desc, regmap);
 }
maintainer Applied
#1 lore raw

Quoting Wei Yongjun (2020-06-27 19:30:55)

Quoted 8 lines

In case of error, the function dev_get_regmap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test.

Fixes 5e77b4ef1b19 ("clk: qcom: Add ipq6018 apss clock controller")

---

Applied to clk-next