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,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: Re: [PATCH 2/3] Thermal: rcar: Convert to devm_ioremap_resource()
Date: Mon, 11 Mar 2013 22:35:32 +0800 [thread overview]
Message-ID: <1363012532.2291.76.camel@rzhang1-mobl4> (raw)
In-Reply-To: <1362379534-30662-2-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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
applied to thermal -next tree.
thanks,
rui
> ---
> drivers/thermal/rcar_thermal.c | 16 ++++++----------
> 1 files changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 28f0919..b28990a 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -399,11 +399,9 @@ static int rcar_thermal_probe(struct platform_device *pdev)
> /*
> * rcar_has_irq_support() will be enabled
> */
> - common->base = devm_request_and_ioremap(dev, res);
> - if (!common->base) {
> - dev_err(dev, "Unable to ioremap thermal register\n");
> - return -ENOMEM;
> - }
> + common->base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(common->base))
> + return PTR_ERR(common->base);
>
> /* enable temperature comparation */
> rcar_thermal_common_write(common, ENR, 0x00030303);
> @@ -422,11 +420,9 @@ static int rcar_thermal_probe(struct platform_device *pdev)
> return -ENOMEM;
> }
>
> - priv->base = devm_request_and_ioremap(dev, res);
> - if (!priv->base) {
> - dev_err(dev, "Unable to ioremap priv register\n");
> - return -ENOMEM;
> - }
> + priv->base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(priv->base))
> + return PTR_ERR(priv->base);
>
> priv->common = common;
> priv->id = i;
next prev 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 [this message]
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
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=1363012532.2291.76.camel@rzhang1-mobl4 \
--to=rui.zhang@intel.com \
--cc=kuninori.morimoto.gx@renesas.com \
--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).