diff options
author | Silviu-Mihai Popescu <silviupopescu1990@gmail.com> | 2013-04-11 05:52:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-04-11 16:21:58 -0400 |
commit | 5760f427ce98fc5576cd4fc7ceadd7ffd9b5feb9 (patch) | |
tree | c61607ff8a7b90681bcdd3beccfe9c1a4a10fa66 /drivers/net/ethernet/stmicro | |
parent | f9725c039720c3b64a274dbbbd22868b4a274cd2 (diff) |
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: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index b43d68b40e50..1d3780f55ba2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | |||
@@ -88,11 +88,9 @@ static int stmmac_pltfr_probe(struct platform_device *pdev) | |||
88 | if (!res) | 88 | if (!res) |
89 | return -ENODEV; | 89 | return -ENODEV; |
90 | 90 | ||
91 | addr = devm_request_and_ioremap(dev, res); | 91 | addr = devm_ioremap_resource(dev, res); |
92 | if (!addr) { | 92 | if (IS_ERR(addr)) |
93 | pr_err("%s: ERROR: memory mapping failed", __func__); | 93 | return PTR_ERR(addr); |
94 | return -ENOMEM; | ||
95 | } | ||
96 | 94 | ||
97 | if (pdev->dev.of_node) { | 95 | if (pdev->dev.of_node) { |
98 | plat_dat = devm_kzalloc(&pdev->dev, | 96 | plat_dat = devm_kzalloc(&pdev->dev, |