linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: Sachin Kamat <sachin.kamat@linaro.org>
Cc: linux-pm@vger.kernel.org, thierry.reding@avionic-design.de,
	Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH 1/3] Thermal: dove: Convert to devm_ioremap_resource()
Date: Mon, 11 Mar 2013 22:35:10 +0800	[thread overview]
Message-ID: <1363012510.2291.75.camel@rzhang1-mobl4> (raw)
In-Reply-To: <1362379534-30662-1-git-send-email-sachin.kamat@linaro.org>

On Mon, 2013-03-04 at 12:15 +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: Andrew Lunn <andrew@lunn.ch>

applied to thermal -next tree.

thanks,
rui
> ---
>  drivers/thermal/dove_thermal.c |   16 ++++++----------
>  1 files changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
> index 7b0bfa0..3078c40 100644
> --- a/drivers/thermal/dove_thermal.c
> +++ b/drivers/thermal/dove_thermal.c
> @@ -143,22 +143,18 @@ static int dove_thermal_probe(struct platform_device *pdev)
>  	if (!priv)
>  		return -ENOMEM;
>  
> -	priv->sensor = devm_request_and_ioremap(&pdev->dev, res);
> -	if (!priv->sensor) {
> -		dev_err(&pdev->dev, "Failed to request_ioremap memory\n");
> -		return -EADDRNOTAVAIL;
> -	}
> +	priv->sensor = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(priv->sensor))
> +		return PTR_ERR(priv->sensor);
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
>  	if (!res) {
>  		dev_err(&pdev->dev, "Failed to get platform resource\n");
>  		return -ENODEV;
>  	}
> -	priv->control = devm_request_and_ioremap(&pdev->dev, res);
> -	if (!priv->control) {
> -		dev_err(&pdev->dev, "Failed to request_ioremap memory\n");
> -		return -EADDRNOTAVAIL;
> -	}
> +	priv->control = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(priv->control))
> +		return PTR_ERR(priv->control);
>  
>  	ret = dove_init_sensor(priv);
>  	if (ret) {



      parent reply	other threads:[~2013-03-11 14:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04  6:45 [PATCH 1/3] Thermal: dove: Convert to devm_ioremap_resource() Sachin Kamat
2013-03-04  6:45 ` [PATCH 2/3] Thermal: rcar: " Sachin Kamat
2013-03-04  7:06   ` Thierry Reding
2013-03-11 14:35   ` Zhang Rui
2013-03-04  6:45 ` [PATCH 3/3] Thermal: kirkwood: " Sachin Kamat
2013-03-04  7:06   ` Thierry Reding
2013-03-04 20:16     ` Nobuhiro Iwamatsu
2013-03-11 14:35   ` Zhang Rui
2013-03-04  7:06 ` [PATCH 1/3] Thermal: dove: " Thierry Reding
2013-03-11 11:37   ` Sachin Kamat
2013-03-11 14:35 ` Zhang Rui [this message]

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=1363012510.2291.75.camel@rzhang1-mobl4 \
    --to=rui.zhang@intel.com \
    --cc=andrew@lunn.ch \
    --cc=linux-pm@vger.kernel.org \
    --cc=sachin.kamat@linaro.org \
    --cc=thierry.reding@avionic-design.de \
    /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;
as well as URLs for NNTP newsgroup(s).