linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: Devendra Naga <devendra.aaru@gmail.com>
Cc: linux-pm@vger.kernel.org
Subject: Re: [PATCH 1/2] thermal: rcar_thermal: propagate return value of thermal_zone_device_register
Date: Mon, 11 Mar 2013 22:47:09 +0800	[thread overview]
Message-ID: <1363013229.2291.80.camel@rzhang1-mobl4> (raw)
In-Reply-To: <1362415968-2210-1-git-send-email-devendra.aaru@gmail.com>

On Mon, 2013-03-04 at 11:52 -0500, Devendra Naga wrote:
> thermal_zone_device_register returns a value contained in the pointer itself
> use PTR_ERR to obtain the address and return it at the end.
> 
> Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>

Applied to thermal -next.

thanks,
rui

> ---
>  drivers/thermal/rcar_thermal.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 28f0919..f1726c9 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -363,6 +363,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  	struct resource *res, *irq;
>  	int mres = 0;
>  	int i;
> +	int ret = -ENODEV;
>  	int idle = IDLE_INTERVAL;
>  
>  	common = devm_kzalloc(dev, sizeof(*common), GFP_KERNEL);
> @@ -441,6 +442,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  						idle);
>  		if (IS_ERR(priv->zone)) {
>  			dev_err(dev, "can't register thermal zone\n");
> +			ret = PTR_ERR(priv->zone);
>  			goto error_unregister;
>  		}
>  
> @@ -460,7 +462,7 @@ error_unregister:
>  	rcar_thermal_for_each_priv(priv, common)
>  		thermal_zone_device_unregister(priv->zone);
>  
> -	return -ENODEV;
> +	return ret;
>  }
>  
>  static int rcar_thermal_remove(struct platform_device *pdev)



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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04 16:52 [PATCH 1/2] thermal: rcar_thermal: propagate return value of thermal_zone_device_register Devendra Naga
2013-03-04 16:52 ` [PATCH 2/2] thermal: exynos_thermal: return a proper error code while thermal_zone_device_register fail Devendra Naga
2013-03-11 14:47   ` Zhang Rui
2013-03-11 14:47 ` 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=1363013229.2291.80.camel@rzhang1-mobl4 \
    --to=rui.zhang@intel.com \
    --cc=devendra.aaru@gmail.com \
    --cc=linux-pm@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).