Skip to content

Commit 8a39b1d

Browse files
committed
memory: renesas-rpc-if: Simplify printing PTR_ERR with dev_err_probe
Use dev_err_probe() to simplify the code and fix Coccinelle warning: renesas-rpc-if.c:1010:3-10: WARNING: Consider using %pe to print PTR_ERR() Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20260226-memory-simplify-v1-1-ccb94f378628@oss.qualcomm.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
1 parent a969a08 commit 8a39b1d

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

drivers/memory/renesas-rpc-if.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,11 +1005,9 @@ static int rpcif_probe(struct platform_device *pdev)
10051005
return PTR_ERR(rpc->base);
10061006
rpc->info = of_device_get_match_data(dev);
10071007
rpc->regmap = devm_regmap_init(dev, NULL, rpc, rpc->info->regmap_config);
1008-
if (IS_ERR(rpc->regmap)) {
1009-
dev_err(dev, "failed to init regmap for rpcif, error %ld\n",
1010-
PTR_ERR(rpc->regmap));
1011-
return PTR_ERR(rpc->regmap);
1012-
}
1008+
if (IS_ERR(rpc->regmap))
1009+
return dev_err_probe(dev, PTR_ERR(rpc->regmap),
1010+
"failed to init regmap for rpcif\n");
10131011

10141012
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dirmap");
10151013
rpc->dirmap = devm_ioremap_resource(dev, res);

0 commit comments

Comments
 (0)