net: stmmac: dwc-qos: use devm_platform_ioremap_resource() to simplify code
authorYueHaibing <yuehaibing@huawei.com>
Wed, 21 Aug 2019 13:57:01 +0000 (21:57 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Aug 2019 20:52:34 +0000 (13:52 -0700)
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c

index f2197b066ed17c2fe79e5413eec208343a23d3eb..dd9967aeda22113bbf06d154c5dc1af3963cbda9 100644 (file)
@@ -418,7 +418,6 @@ static int dwc_eth_dwmac_probe(struct platform_device *pdev)
        const struct dwc_eth_dwmac_data *data;
        struct plat_stmmacenet_data *plat_dat;
        struct stmmac_resources stmmac_res;
-       struct resource *res;
        void *priv;
        int ret;
 
@@ -435,8 +434,7 @@ static int dwc_eth_dwmac_probe(struct platform_device *pdev)
                return stmmac_res.irq;
        stmmac_res.wol_irq = stmmac_res.irq;
 
-       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);
        if (IS_ERR(stmmac_res.addr))
                return PTR_ERR(stmmac_res.addr);