[PATCH next] clk: mmp: pxa1908: Fix IS_ERR() vs NULL check in probe()

Dan Carpenter posted 1 patch 5 days, 18 hours ago
drivers/clk/mmp/clk-pxa1908-apmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH next] clk: mmp: pxa1908: Fix IS_ERR() vs NULL check in probe()
Posted by Dan Carpenter 5 days, 18 hours ago
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")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/clk/mmp/clk-pxa1908-apmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/mmp/clk-pxa1908-apmu.c b/drivers/clk/mmp/clk-pxa1908-apmu.c
index 7594a495a009..e374d7733f56 100644
--- a/drivers/clk/mmp/clk-pxa1908-apmu.c
+++ b/drivers/clk/mmp/clk-pxa1908-apmu.c
@@ -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);
-- 
2.51.0
Re: [PATCH next] clk: mmp: pxa1908: Fix IS_ERR() vs NULL check in probe()
Posted by Duje Mihanović 5 days, 3 hours ago
On Friday, 26 September 2025 06:03:21 Central European Summer Time Dan Carpenter wrote:
> 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---

Acked-by: Duje Mihanović <duje@dujemihanovic.xyz>

Regards,
--
Duje