Commit 999232a3 authored by YueHaibing's avatar YueHaibing Committed by David S. Miller

net: stmmac: dwmac-meson8b: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Reviewed-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 913919e5
...@@ -308,7 +308,6 @@ static int meson8b_dwmac_probe(struct platform_device *pdev) ...@@ -308,7 +308,6 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
{ {
struct plat_stmmacenet_data *plat_dat; struct plat_stmmacenet_data *plat_dat;
struct stmmac_resources stmmac_res; struct stmmac_resources stmmac_res;
struct resource *res;
struct meson8b_dwmac *dwmac; struct meson8b_dwmac *dwmac;
int ret; int ret;
...@@ -332,8 +331,7 @@ static int meson8b_dwmac_probe(struct platform_device *pdev) ...@@ -332,8 +331,7 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
ret = -EINVAL; ret = -EINVAL;
goto err_remove_config_dt; goto err_remove_config_dt;
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); dwmac->regs = devm_platform_ioremap_resource(pdev, 1);
dwmac->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(dwmac->regs)) { if (IS_ERR(dwmac->regs)) {
ret = PTR_ERR(dwmac->regs); ret = PTR_ERR(dwmac->regs);
goto err_remove_config_dt; goto err_remove_config_dt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment