Commit 84e81922 authored by Sachin Kamat's avatar Sachin Kamat Committed by Greg Kroah-Hartman

serial: tegra: Convert to devm_ioremap_resource()

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: default avatarSachin Kamat <sachin.kamat@linaro.org>
Reviewed-by: default avatarThierry Reding <thierry.reding@avionic-design.de>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 19ffd68f
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/dmaengine.h> #include <linux/dmaengine.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/dmapool.h> #include <linux/dmapool.h>
#include <linux/err.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -1301,11 +1302,9 @@ static int tegra_uart_probe(struct platform_device *pdev) ...@@ -1301,11 +1302,9 @@ static int tegra_uart_probe(struct platform_device *pdev)
} }
u->mapbase = resource->start; u->mapbase = resource->start;
u->membase = devm_request_and_ioremap(&pdev->dev, resource); u->membase = devm_ioremap_resource(&pdev->dev, resource);
if (!u->membase) { if (IS_ERR(u->membase))
dev_err(&pdev->dev, "memregion/iomap address req failed\n"); return PTR_ERR(u->membase);
return -EADDRNOTAVAIL;
}
tup->uart_clk = devm_clk_get(&pdev->dev, NULL); tup->uart_clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(tup->uart_clk)) { if (IS_ERR(tup->uart_clk)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment