]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers: mtd: nand: davinci: use devm_ioremap_resource()
authorLaurent Navet <laurent.navet@gmail.com>
Thu, 2 May 2013 13:56:10 +0000 (15:56 +0200)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 29 May 2013 13:48:42 +0000 (16:48 +0300)
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@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/nand/davinci_nand.c

index c3e15a55817349eb4ed2e1c86009b042c38e2405..999ad9cb29012ff6d1d96db1fa33c134d84a133d 100644 (file)
@@ -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;
        }