serial: Convert to devm_ioremap_resource()
authorThierry Reding <thierry.reding@avionic-design.de>
Mon, 21 Jan 2013 10:09:21 +0000 (11:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jan 2013 19:41:57 +0000 (11:41 -0800)
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: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sccnxp.c

index 418b495..e869eab 100644 (file)
@@ -15,6 +15,7 @@
 #define SUPPORT_SYSRQ
 #endif
 
+#include <linux/err.h>
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/console.h>
@@ -875,10 +876,9 @@ static int sccnxp_probe(struct platform_device *pdev)
                goto err_out;
        }
 
-       membase = devm_request_and_ioremap(&pdev->dev, res);
-       if (!membase) {
-               dev_err(&pdev->dev, "Failed to ioremap\n");
-               ret = -EIO;
+       membase = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(membase)) {
+               ret = PTR_ERR(membase);
                goto err_out;
        }