mtd: nand: davinci: use devm_ioremap_resource()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Aug 5 16:59:03 EDT 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=59bff7fb7a0b461320744a9a9b7bf75b8eeddea8
Commit:     59bff7fb7a0b461320744a9a9b7bf75b8eeddea8
Parent:     d914c932d7764bf9633af974940aee9390adf20d
Author:     Laurent Navet <laurent.navet at gmail.com>
AuthorDate: Thu May 2 15:56:10 2013 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Aug 5 20:49:10 2013 +0100

    mtd: nand: davinci: use devm_ioremap_resource()
    
    Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.
    
    Found with coccicheck and this semantic patch:
     scripts/coccinelle/api/devm_request_and_ioremap.cocci.
    
    Signed-off-by: Laurent Navet <laurent.navet at gmail.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/davinci_nand.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index c3e15a5..999ad9c 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -623,11 +623,14 @@ static int __init nand_davinci_probe(struct platform_device *pdev)
 		goto err_nomem;
 	}
 
-	vaddr = devm_request_and_ioremap(&pdev->dev, res1);
-	base = devm_request_and_ioremap(&pdev->dev, res2);
-	if (!vaddr || !base) {
-		dev_err(&pdev->dev, "ioremap failed\n");
-		ret = -EADDRNOTAVAIL;
+	vaddr = devm_ioremap_resource(&pdev->dev, res1);
+	if (IS_ERR(vaddr)) {
+		ret = PTR_ERR(vaddr);
+		goto err_ioremap;
+	}
+	base = devm_ioremap_resource(&pdev->dev, res2);
+	if (IS_ERR(base)) {
+		ret = PTR_ERR(base);
 		goto err_ioremap;
 	}
 



More information about the linux-mtd-cvs mailing list