diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-08-21 16:54:06 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-21 23:52:33 +0300 |
commit | f33bf6b00f20c9d26c42dfdaf8b83c2b0c1e6f71 (patch) | |
tree | 067f1e8849c56f0c8011778195960309bd3b3cff /drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c | |
parent | 999232a38ff10209df1ce40cabe8cf8982c530e7 (diff) | |
download | linux-f33bf6b00f20c9d26c42dfdaf8b83c2b0c1e6f71.tar.xz |
net: stmmac: dwmac-meson: 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>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c index 88eb16954627..bbc16b5a410a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c @@ -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; |