Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: d54c1fd4a51e ("clk: Add Sunplus SP7021 clock driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20231128133016.2494699-1-yangyingliang@huawei.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Yang Yingliang and committed by
Stephen Boyd
1004c346 b85ea95d

+6 -6
+6 -6
drivers/clk/clk-sp7021.c
··· 604 604 int i; 605 605 606 606 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); 609 609 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); 612 612 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); 615 615 616 616 /* enable default clks */ 617 617 for (i = 0; i < ARRAY_SIZE(sp_clken); i++)