drivers: misc: use devm_ioremap_resource()
authorLaurent Navet <laurent.navet@gmail.com>
Thu, 2 May 2013 12:39:34 +0000 (14:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2013 01:11:13 +0000 (18:11 -0700)
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/sram.c

index 437192e..4a93886 100644 (file)
@@ -50,9 +50,10 @@ static int sram_probe(struct platform_device *pdev)
 
        size = resource_size(res);
 
-       virt_base = devm_request_and_ioremap(&pdev->dev, res);
-       if (!virt_base)
-               return -EADDRNOTAVAIL;
+       virt_base = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(virt_base))
+               return PTR_ERR(virt_base);
+
 
        sram = devm_kzalloc(&pdev->dev, sizeof(*sram), GFP_KERNEL);
        if (!sram)