Skip to content

Commit

Permalink
net: stmmac: platform: convert to devm_platform_ioremap_resource
Browse files Browse the repository at this point in the history
Use devm_platform_ioremap_resource() to simplify code, which
contains platform_get_resource and devm_ioremap_resource.

Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dejin Zheng authored and davem330 committed Mar 15, 2020
1 parent 4a601f1 commit 7a1d0e6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 7a1d0e6

Please sign in to comment.