]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net: stmmac: platform: convert to devm_platform_ioremap_resource
authorDejin Zheng <zhengdejin5@gmail.com>
Fri, 13 Mar 2020 14:42:57 +0000 (22:42 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 15 Mar 2020 07:17:41 +0000 (00:17 -0700)
Use devm_platform_ioremap_resource() to simplify code, which
contains platform_get_resource and devm_ioremap_resource.

Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

index 165958c9f0699ae84076e41cd71171798eae5835..ac80373b57e6b561b24e7ea0552bef781cd33813 100644 (file)
@@ -645,8 +645,6 @@ EXPORT_SYMBOL_GPL(stmmac_remove_config_dt);
 int stmmac_get_platform_resources(struct platform_device *pdev,
                                  struct stmmac_resources *stmmac_res)
 {
-       struct resource *res;
-
        memset(stmmac_res, 0, sizeof(*stmmac_res));
 
        /* Get IRQ information early to have an ability to ask for deferred
@@ -674,8 +672,7 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
        if (stmmac_res->lpi_irq == -EPROBE_DEFER)
                return -EPROBE_DEFER;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       stmmac_res->addr = devm_ioremap_resource(&pdev->dev, res);
+       stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0);
 
        return PTR_ERR_OR_ZERO(stmmac_res->addr);
 }