]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: enetc: Use devm_platform_get_and_ioremap_resource()
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 7 Jun 2021 13:57:14 +0000 (21:57 +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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/enetc/enetc_ierb.c

index 8b356c485507e334f9235a3ae58d8be3e38a5f83..ee1468e3eaa3fc357c1e761918f3905ed31a018b 100644 (file)
@@ -99,15 +99,13 @@ EXPORT_SYMBOL(enetc_ierb_register_pf);
 static int enetc_ierb_probe(struct platform_device *pdev)
 {
        struct enetc_ierb *ierb;
-       struct resource *res;
        void __iomem *regs;
 
        ierb = devm_kzalloc(&pdev->dev, sizeof(*ierb), GFP_KERNEL);
        if (!ierb)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       regs = devm_ioremap_resource(&pdev->dev, res);
+       regs = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
        if (IS_ERR(regs))
                return PTR_ERR(regs);