summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinghao Chi <chi.minghao@zte.com.cn>2022-11-11 14:43:00 +0800
committerMarc Kleine-Budde <mkl@pengutronix.de>2022-12-12 11:39:12 +0100
commit74d95352bdfc4ed1eb72ef9d69e06ed2d6891ff7 (patch)
tree18e60c7365f5d2d4209f7d8abbf6dd9f1e7f76c2
parent5237ff4e7d3d60e19c0625169361eb40cd435f6d (diff)
can: c_can: use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/all/202211111443005202576@zte.com.cn Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r--drivers/net/can/c_can/c_can_platform.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index 86e95e9d6533..03ccb7cfacaf 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -290,8 +290,7 @@ static int c_can_plat_probe(struct platform_device *pdev)
goto exit;
}
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- addr = devm_ioremap_resource(&pdev->dev, mem);
+ addr = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
if (IS_ERR(addr)) {
ret = PTR_ERR(addr);
goto exit;