Skip to content

Commit 1004c34

Browse files
Yang Yingliangbebarino
authored andcommitted
clk: sp7021: fix return value check in sp7021_clk_probe()
devm_platform_ioremap_resource() never returns NULL pointer, it will return ERR_PTR() when it fails, so replace the check with IS_ERR(). Fixes: d54c1fd ("clk: Add Sunplus SP7021 clock driver") Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent b85ea95 commit 1004c34

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/clk/clk-sp7021.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -604,14 +604,14 @@ static int sp7021_clk_probe(struct platform_device *pdev)
604604
int i;
605605

606606
clk_base = devm_platform_ioremap_resource(pdev, 0);
607-
if (!clk_base)
608-
return -ENXIO;
607+
if (IS_ERR(clk_base))
608+
return PTR_ERR(clk_base);
609609
pll_base = devm_platform_ioremap_resource(pdev, 1);
610-
if (!pll_base)
611-
return -ENXIO;
610+
if (IS_ERR(pll_base))
611+
return PTR_ERR(pll_base);
612612
sys_base = devm_platform_ioremap_resource(pdev, 2);
613-
if (!sys_base)
614-
return -ENXIO;
613+
if (IS_ERR(sys_base))
614+
return PTR_ERR(sys_base);
615615

616616
/* enable default clks */
617617
for (i = 0; i < ARRAY_SIZE(sp_clken); i++)

0 commit comments

Comments
 (0)