Skip to content

Commit 470ac62

Browse files
Yang Limarckleinebudde
authored andcommitted
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]>
1 parent 40967f7 commit 470ac62

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/net/can/ctucanfd/ctucanfd_platform.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,14 @@ static void ctucan_platform_set_drvdata(struct device *dev,
4747
*/
4848
static int ctucan_platform_probe(struct platform_device *pdev)
4949
{
50-
struct resource *res; /* IO mem resources */
5150
struct device *dev = &pdev->dev;
5251
void __iomem *addr;
5352
int ret;
5453
unsigned int ntxbufs;
5554
int irq;
5655

5756
/* Get the virtual base address for the device */
58-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
59-
addr = devm_ioremap_resource(dev, res);
57+
addr = devm_platform_ioremap_resource(pdev, 0);
6058
if (IS_ERR(addr)) {
6159
ret = PTR_ERR(addr);
6260
goto err;

0 commit comments

Comments
 (0)