]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
serial: tegra: Convert to devm_ioremap_resource()
authorSachin Kamat <sachin.kamat@linaro.org>
Mon, 4 Mar 2013 04:29:00 +0000 (09:59 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Mar 2013 20:55:22 +0000 (13:55 -0700)
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() 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: Sachin Kamat <sachin.kamat@linaro.org>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial-tegra.c

index 372de8ade76a2fce2451874360b093c6f1ee5a75..9799d043a9bd8e0a9e8d6142f47caf85eceee484 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/dmaengine.h>
 #include <linux/dma-mapping.h>
 #include <linux/dmapool.h>
+#include <linux/err.h>
 #include <linux/io.h>
 #include <linux/irq.h>
 #include <linux/module.h>
@@ -1301,11 +1302,9 @@ static int tegra_uart_probe(struct platform_device *pdev)
        }
 
        u->mapbase = resource->start;
-       u->membase = devm_request_and_ioremap(&pdev->dev, resource);
-       if (!u->membase) {
-               dev_err(&pdev->dev, "memregion/iomap address req failed\n");
-               return -EADDRNOTAVAIL;
-       }
+       u->membase = devm_ioremap_resource(&pdev->dev, resource);
+       if (IS_ERR(u->membase))
+               return PTR_ERR(u->membase);
 
        tup->uart_clk = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(tup->uart_clk)) {