net: stmmac: dwmac-meson: use devm_platform_ioremap_resource() to simplify code
authorYueHaibing <yuehaibing@huawei.com>
Wed, 21 Aug 2019 13:54:06 +0000 (21:54 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Aug 2019 20:52:33 +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>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c

index 88eb16954627c8e50b5e285a35916fe84adc879d..bbc16b5a410a8e21d8d3b8fee2127b0a77da6bf9 100644 (file)
@@ -46,7 +46,6 @@ static int meson6_dwmac_probe(struct platform_device *pdev)
        struct plat_stmmacenet_data *plat_dat;
        struct stmmac_resources stmmac_res;
        struct meson_dwmac *dwmac;
-       struct resource *res;
        int ret;
 
        ret = stmmac_get_platform_resources(pdev, &stmmac_res);
@@ -63,8 +62,7 @@ static int meson6_dwmac_probe(struct platform_device *pdev)
                goto err_remove_config_dt;
        }
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-       dwmac->reg = devm_ioremap_resource(&pdev->dev, res);
+       dwmac->reg = devm_platform_ioremap_resource(pdev, 1);
        if (IS_ERR(dwmac->reg)) {
                ret = PTR_ERR(dwmac->reg);
                goto err_remove_config_dt;