Skip to contentSkip to conversation

clk: mmp: pxa1908: Fix IS_ERR() vs NULL check in probe()

PATCH In review Dan Carpenter 2 participants 2 messages Sep 26, 2025

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

PATCH 1/1 clk: mmp: pxa1908: Fix IS_ERR() vs NULL check in probe()

The devm_auxiliary_device_create() function returns NULL on error, it never returns error pointers. Change the IS_ERR() check to a NULL check.

Fixes a787ab591c38 ("clk: mmp: pxa1908: Instantiate power driver through auxiliary bus")
---
 drivers/clk/mmp/clk-pxa1908-apmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/mmp/clk-pxa1908-apmu.c +2 -2
index 7594a495a009..e374d7733f56 100644
@@ -97,8 +97,8 @@ static int pxa1908_apmu_probe(struct platform_device *pdev)
 		return PTR_ERR(pxa_unit->base);
 
 	adev = devm_auxiliary_device_create(&pdev->dev, "power", NULL);
-	if (IS_ERR(adev))
-		return dev_err_probe(&pdev->dev, PTR_ERR(adev),
+	if (!adev)
+		return dev_err_probe(&pdev->dev, -ENODEV,
 				     "Failed to register power controller\n");
 
 	mmp_clk_init(pdev->dev.of_node, &pxa_unit->unit, APMU_NR_CLKS);
Signature · 1 line
2.51.0
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Friday, 26 September 2025 06:03:21 Central European Summer Time Dan…

The devm_auxiliary_device_create() function returns NULL on error, it never returns error pointers. Change the IS_ERR() check to a NULL check.

Fixes a787ab591c38 ("clk: mmp: pxa1908: Instantiate power driver through auxiliary bus")

---

Regards,
--
Duje