From b0de774c6334dccdcd43a7ef46155a1f3a52a954 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 21 Jan 2013 11:09:12 +0100 Subject: mtd: Convert to devm_ioremap_resource() Convert all uses 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. Signed-off-by: Thierry Reding Cc: David Woodhouse Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/maps/autcpu12-nvram.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/mtd/maps/autcpu12-nvram.c') diff --git a/drivers/mtd/maps/autcpu12-nvram.c b/drivers/mtd/maps/autcpu12-nvram.c index a2dc2ae4b24e..c3525d2a2fa8 100644 --- a/drivers/mtd/maps/autcpu12-nvram.c +++ b/drivers/mtd/maps/autcpu12-nvram.c @@ -16,6 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include @@ -55,12 +56,10 @@ static int autcpu12_nvram_probe(struct platform_device *pdev) priv->map.bankwidth = 4; priv->map.phys = res->start; priv->map.size = resource_size(res); - priv->map.virt = devm_request_and_ioremap(&pdev->dev, res); + priv->map.virt = devm_ioremap_resource(&pdev->dev, res); strcpy((char *)priv->map.name, res->name); - if (!priv->map.virt) { - dev_err(&pdev->dev, "failed to remap mem resource\n"); - return -EBUSY; - } + if (IS_ERR(priv->map.virt)) + return PTR_ERR(priv->map.virt); simple_map_init(&priv->map); -- cgit v1.2.3