diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-08-21 16:55:50 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-21 23:52:33 +0300 |
commit | ad124aa34e514393218f46f9701fdeaf35cbf5d3 (patch) | |
tree | 76695e4e6283b01d698da71e4dc0581d2876fb68 /drivers/net/ethernet | |
parent | f33bf6b00f20c9d26c42dfdaf8b83c2b0c1e6f71 (diff) | |
download | linux-ad124aa34e514393218f46f9701fdeaf35cbf5d3.tar.xz |
net: stmmac: dwmac-anarion: 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: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c index 6ce3a7fb41ab..527f93320a5a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c @@ -62,12 +62,10 @@ static void anarion_gmac_exit(struct platform_device *pdev, void *priv) static struct anarion_gmac *anarion_config_dt(struct platform_device *pdev) { int phy_mode; - struct resource *res; void __iomem *ctl_block; struct anarion_gmac *gmac; - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - ctl_block = devm_ioremap_resource(&pdev->dev, res); + ctl_block = devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(ctl_block)) { dev_err(&pdev->dev, "Cannot get reset region (%ld)!\n", PTR_ERR(ctl_block)); |