From: Silviu-Mihai Popescu Date: Thu, 11 Apr 2013 09:52:13 +0000 (+0000) Subject: net: ethernet: stmicro: stmmac: use devm_ioremap_resource() X-Git-Tag: v3.10-rc1~120^2~143 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=5760f427ce98fc5576cd4fc7ceadd7ffd9b5feb9;p=~emulex%2Finfiniband.git 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index b43d68b40e5..1d3780f55ba 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) if (!res) return -ENODEV; - addr = devm_request_and_ioremap(dev, res); - if (!addr) { - pr_err("%s: ERROR: memory mapping failed", __func__); - return -ENOMEM; - } + addr = devm_ioremap_resource(dev, res); + if (IS_ERR(addr)) + return PTR_ERR(addr); if (pdev->dev.of_node) { plat_dat = devm_kzalloc(&pdev->dev,