[PATCH] clk / soc: mediatek: fix ptr_ret.cocci warnings
From: kbuild test robot
Date: Sat May 09 2020 - 22:56:09 EST
From: kbuild test robot <lkp@xxxxxxxxx>
drivers/soc/mediatek/mtk-mmsys.c:28:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
Generated by: scripts/coccinelle/api/ptr_ret.cocci
Fixes: 13032709e232 ("clk / soc: mediatek: Move mt8173 MMSYS to platform driver")
CC: Matthias Brugger <mbrugger@xxxxxxxx>
Signed-off-by: kbuild test robot <lkp@xxxxxxxxx>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 30e2206e11ce27ae910cc0dab21472429e400a87
commit: 13032709e2328553970f0002df5edce6aac69425 [1266/7905] clk / soc: mediatek: Move mt8173 MMSYS to platform driver
mtk-mmsys.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/drivers/soc/mediatek/mtk-mmsys.c
+++ b/drivers/soc/mediatek/mtk-mmsys.c
@@ -25,10 +25,7 @@ static int mtk_mmsys_probe(struct platfo
clks = platform_device_register_data(&pdev->dev, data->clk_driver,
PLATFORM_DEVID_AUTO, NULL, 0);
- if (IS_ERR(clks))
- return PTR_ERR(clks);
-
- return 0;
+ return PTR_ERR_OR_ZERO(clks);
}
static const struct of_device_id of_match_mtk_mmsys[] = {