linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: tty: serial: use devm_ioremap_resource()
@ 2013-04-11 19:58 Silviu-Mihai Popescu
  2013-04-11 20:24 ` [PATCH] drivers: tty: serial: tegra: " Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Silviu-Mihai Popescu @ 2013-04-11 19:58 UTC (permalink / raw)
  To: linux-serial
  Cc: Greg Kroah-Hartman, Jiri Slaby, Stephen Warren, linux-tegra,
	linux-kernel, Silviu-Mihai Popescu

Convert  use 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.

This was found with coccinelle.

Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
---
 drivers/tty/serial/serial-tegra.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
index 372de8a..2080fd7 100644
--- a/drivers/tty/serial/serial-tegra.c
+++ b/drivers/tty/serial/serial-tegra.c
@@ -1301,11 +1301,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)) {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers: tty: serial: tegra: use devm_ioremap_resource()
  2013-04-11 19:58 [PATCH] drivers: tty: serial: use devm_ioremap_resource() Silviu-Mihai Popescu
@ 2013-04-11 20:24 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2013-04-11 20:24 UTC (permalink / raw)
  To: Silviu-Mihai Popescu
  Cc: linux-serial, Jiri Slaby, Stephen Warren, linux-tegra,
	linux-kernel

On Thu, Apr 11, 2013 at 10:58:57PM +0300, Silviu-Mihai Popescu wrote:
> Convert  use 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.
> 
> This was found with coccinelle.

And it's already in my tree, please always work off of linux-next to
avoid doing the same thing that others have done.

sorry,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-11 20:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-11 19:58 [PATCH] drivers: tty: serial: use devm_ioremap_resource() Silviu-Mihai Popescu
2013-04-11 20:24 ` [PATCH] drivers: tty: serial: tegra: " Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).