Commit 5760f427 authored by Silviu-Mihai Popescu's avatar Silviu-Mihai Popescu Committed by David S. Miller

net: ethernet: stmicro: stmmac: use devm_ioremap_resource()

Convert  use of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

devm_ioremap_resource() provides its own error messages so all explicit
error messages can be removed from the failure code paths.

This was found with coccinelle.
Signed-off-by: default avatarSilviu-Mihai Popescu <silviupopescu1990@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f9725c03
...@@ -88,11 +88,9 @@ static int stmmac_pltfr_probe(struct platform_device *pdev) ...@@ -88,11 +88,9 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
if (!res) if (!res)
return -ENODEV; return -ENODEV;
addr = devm_request_and_ioremap(dev, res); addr = devm_ioremap_resource(dev, res);
if (!addr) { if (IS_ERR(addr))
pr_err("%s: ERROR: memory mapping failed", __func__); return PTR_ERR(addr);
return -ENOMEM;
}
if (pdev->dev.of_node) { if (pdev->dev.of_node) {
plat_dat = devm_kzalloc(&pdev->dev, plat_dat = devm_kzalloc(&pdev->dev,
......
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