Merge tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[firefly-linux-kernel-4.4.55.git] / drivers / staging / omap-thermal / omap-bandgap.c
index 89f7180b5e013a1a30f9be4374d7007c3aef842a..dcc1448dbf8e8b2f7d74ab3d4a4735c8878a246c 100644 (file)
@@ -818,15 +818,12 @@ static struct omap_bandgap *omap_bandgap_build(struct platform_device *pdev)
                res = platform_get_resource(pdev, IORESOURCE_MEM, i);
                if (!res)
                        break;
-               chunk = devm_request_and_ioremap(&pdev->dev, res);
+               chunk = devm_ioremap_resource(&pdev->dev, res);
                if (i == 0)
                        bg_ptr->base = chunk;
-               if (!chunk) {
-                       dev_err(&pdev->dev,
-                               "failed to request the IO (%d:%pR).\n",
-                               i, res);
-                       return ERR_PTR(-EADDRNOTAVAIL);
-               }
+               if (IS_ERR(chunk))
+                       return ERR_CAST(chunk);
+               
                i++;
        } while (res);