mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@avionic-design.de>
To: Sachin Kamat <sachin.kamat@linaro.org>
Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
	Laxman Dewangan <ldewangan@nvidia.com>,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH v2 2/2] serial: tegra: Convert to devm_ioremap_resource()
Date: Fri, 1 Feb 2013 12:24:37 +0100	[thread overview]
Message-ID: <20130201112437.GB29105@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <1359713277-14228-2-git-send-email-sachin.kamat@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1831 bytes --]

On Fri, Feb 01, 2013 at 03:37:57PM +0530, Sachin Kamat wrote:
> 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>
> Cc: Laxman Dewangan <ldewangan@nvidia.com>
> Cc: linux-serial@vger.kernel.org
> ---
> Patch based & compile tested on linux-next tree (20130128).
> Changes since v1:
> * Dropped the error message as it is now handled by devm_ioremap_resource()
> itself.
> ---
>  drivers/tty/serial/serial-tegra.c |    9 ++++-----
>  1 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
> index 4f5e629..24ced23 100644
> --- a/drivers/tty/serial/serial-tegra.c
> +++ b/drivers/tty/serial/serial-tegra.c
> @@ -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>
> @@ -1302,11 +1303,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)) {

Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-02-01 11:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-01 10:07 [PATCH v2 1/2] Input: tegra-kbc- " Sachin Kamat
2013-02-01 10:07 ` [PATCH v2 2/2] serial: tegra: " Sachin Kamat
2013-02-01 11:24   ` Thierry Reding [this message]
2013-02-01 11:24 ` [PATCH v2 1/2] Input: tegra-kbc- " Thierry Reding
2013-02-04  5:16 ` Sachin Kamat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130201112437.GB29105@avionic-0098.mockup.avionic-design.de \
    --to=thierry.reding@avionic-design.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=sachin.kamat@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome