Commit 7a1d0e61 authored by Dejin Zheng's avatar Dejin Zheng Committed by David S. Miller

net: stmmac: platform: convert to devm_platform_ioremap_resource

Use devm_platform_ioremap_resource() to simplify code, which
contains platform_get_resource and devm_ioremap_resource.
Signed-off-by: default avatarDejin Zheng <zhengdejin5@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4a601f10
...@@ -645,8 +645,6 @@ EXPORT_SYMBOL_GPL(stmmac_remove_config_dt); ...@@ -645,8 +645,6 @@ EXPORT_SYMBOL_GPL(stmmac_remove_config_dt);
int stmmac_get_platform_resources(struct platform_device *pdev, int stmmac_get_platform_resources(struct platform_device *pdev,
struct stmmac_resources *stmmac_res) struct stmmac_resources *stmmac_res)
{ {
struct resource *res;
memset(stmmac_res, 0, sizeof(*stmmac_res)); memset(stmmac_res, 0, sizeof(*stmmac_res));
/* Get IRQ information early to have an ability to ask for deferred /* Get IRQ information early to have an ability to ask for deferred
...@@ -674,8 +672,7 @@ int stmmac_get_platform_resources(struct platform_device *pdev, ...@@ -674,8 +672,7 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
if (stmmac_res->lpi_irq == -EPROBE_DEFER) if (stmmac_res->lpi_irq == -EPROBE_DEFER)
return -EPROBE_DEFER; return -EPROBE_DEFER;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0);
stmmac_res->addr = devm_ioremap_resource(&pdev->dev, res);
return PTR_ERR_OR_ZERO(stmmac_res->addr); return PTR_ERR_OR_ZERO(stmmac_res->addr);
} }
......
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