aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Li <[email protected]>2023-02-16 17:06:10 +0800
committerMarc Kleine-Budde <[email protected]>2023-02-16 20:56:11 +0100
commit470ac62dfa5732c149adce2cbce84ac678de701f (patch)
tree49c8995b1819c505e59f8235c6303f2f44bc4ab4
parent40967f77dfa9fa728b7f36a5d2eb432f39de185c (diff)
can: ctucanfd: ctucan_platform_probe(): use devm_platform_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single call to Use devm_platform_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yang Li <[email protected]> Reviewed-by: Alexander Lobakin <[email protected]> Acked-by: Pavel Pisa <[email protected]> Link: https://lore.kernel.org/all/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
-rw-r--r--drivers/net/can/ctucanfd/ctucanfd_platform.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/can/ctucanfd/ctucanfd_platform.c b/drivers/net/can/ctucanfd/ctucanfd_platform.c
index f83684f006ea..a17561d97192 100644
--- a/drivers/net/can/ctucanfd/ctucanfd_platform.c
+++ b/drivers/net/can/ctucanfd/ctucanfd_platform.c
@@ -47,7 +47,6 @@ static void ctucan_platform_set_drvdata(struct device *dev,
*/
static int ctucan_platform_probe(struct platform_device *pdev)
{
- struct resource *res; /* IO mem resources */
struct device *dev = &pdev->dev;
void __iomem *addr;
int ret;
@@ -55,8 +54,7 @@ static int ctucan_platform_probe(struct platform_device *pdev)
int irq;
/* Get the virtual base address for the device */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- addr = devm_ioremap_resource(dev, res);
+ addr = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(addr)) {
ret = PTR_ERR(addr);
goto err;