clk: mmp: pxa1908: Fix IS_ERR() vs NULL check in probe()
Subsystems (3)
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")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/clk/mmp/clk-pxa1908-apmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/mmp/clk-pxa1908-apmu.c +2 -2
@@ -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
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 theIS_ERR()check to a NULL check.Fixes a787ab591c38 ("clk: mmp: pxa1908: Instantiate power driver through auxiliary bus")Signed-off-by Dan Carpenter <[email protected]>---
Acked-by Duje Mihanović <[email protected]>
Regards,
--
Duje