提交 7a1d0e61 编写于 作者: D Dejin Zheng 提交者: 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: NDejin Zheng <zhengdejin5@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4a601f10
......@@ -645,8 +645,6 @@ EXPORT_SYMBOL_GPL(stmmac_remove_config_dt);
int stmmac_get_platform_resources(struct platform_device *pdev,
struct stmmac_resources *stmmac_res)
{
struct resource *res;
memset(stmmac_res, 0, sizeof(*stmmac_res));
/* 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,
if (stmmac_res->lpi_irq == -EPROBE_DEFER)
return -EPROBE_DEFER;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
stmmac_res->addr = devm_ioremap_resource(&pdev->dev, res);
stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0);
return PTR_ERR_OR_ZERO(stmmac_res->addr);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册