]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: macb: Use devm_platform_get_and_ioremap_resource()
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 7 Jun 2021 13:43:54 +0000 (21:43 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Jun 2021 21:07:22 +0000 (14:07 -0700)
Use devm_platform_get_and_ioremap_resource() to simplify
code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb_main.c

index a0c7b1167dbb243d436b58d5e948332b72a513f4..7d2fe13a52f88bba83e70bb58930e8db4edf655a 100644 (file)
@@ -4655,8 +4655,7 @@ static int macb_probe(struct platform_device *pdev)
        struct macb *bp;
        int err, val;
 
-       regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       mem = devm_ioremap_resource(&pdev->dev, regs);
+       mem = devm_platform_get_and_ioremap_resource(pdev, 0, &regs);
        if (IS_ERR(mem))
                return PTR_ERR(mem);