aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/lpc32xx_mlc.c
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@avionic-design.de>2013-01-21 11:09:12 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-25 12:21:47 -0800
commitb0de774c6334dccdcd43a7ef46155a1f3a52a954 (patch)
treed845a8ea2c8f5d556591829ec1829f216ad0cbb1 /drivers/mtd/nand/lpc32xx_mlc.c
parenta3e2cd7f24ba7521169943ace3d14b567487ea29 (diff)
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 <thierry.reding@avionic-design.de> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mtd/nand/lpc32xx_mlc.c')
-rw-r--r--drivers/mtd/nand/lpc32xx_mlc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/mtd/nand/lpc32xx_mlc.c b/drivers/mtd/nand/lpc32xx_mlc.c
index f182befa736..0ca22ae9135 100644
--- a/drivers/mtd/nand/lpc32xx_mlc.c
+++ b/drivers/mtd/nand/lpc32xx_mlc.c
@@ -677,11 +677,10 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
return -ENXIO;
}
- host->io_base = devm_request_and_ioremap(&pdev->dev, rc);
- if (host->io_base == NULL) {
- dev_err(&pdev->dev, "ioremap failed\n");
- return -EIO;
- }
+ host->io_base = devm_ioremap_resource(&pdev->dev, rc);
+ if (IS_ERR(host->io_base))
+ return PTR_ERR(host->io_base);
+
host->io_base_phy = rc->start;
mtd = &host->mtd;