All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@st.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Vincenzo FRASCINO <Vincenzo.FRASCINO@st.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>,
	Shiraz HASHIM <shiraz.hashim@st.com>,
	Armando VISCONTI <armando.visconti@st.com>
Subject: Re: [patch] thermal: spear13xx: checking for NULL instead of IS_ERR()
Date: Wed, 29 Feb 2012 06:46:01 +0000	[thread overview]
Message-ID: <4F4DC6D9.7050204@st.com> (raw)
In-Reply-To: <20120229063151.GA18031@elgon.mountain>

On 2/29/2012 12:01 PM, Dan Carpenter wrote:
> thermal_zone_device_register() never returns NULL, on error it returns
> and ERR_PTR().
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
> index 880bf28..7352cf8 100644
> --- a/drivers/thermal/spear_thermal.c
> +++ b/drivers/thermal/spear_thermal.c
> @@ -149,9 +149,9 @@ static int spear_thermal_probe(struct platform_device *pdev)
>  
>  	spear_thermal = thermal_zone_device_register("spear_thermal", 0,
>  				stdev, &ops, 0, 0, 0, 0);
> -	if (!spear_thermal) {
> +	if (IS_ERR(spear_thermal)) {
>  		dev_err(&pdev->dev, "thermal zone device is NULL\n");
> -		ret = -EINVAL;
> +		ret = PTR_ERR(spear_thermal);
>  		goto disable_clk;
>  	}
>  

Thanks.

Reviewed-by: Viresh Kumar <viresh.kumar@st.com>

-- 
viresh

WARNING: multiple messages have this Message-ID (diff)
From: Viresh Kumar <viresh.kumar@st.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Vincenzo FRASCINO <Vincenzo.FRASCINO@st.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>,
	Shiraz HASHIM <shiraz.hashim@st.com>,
	Armando VISCONTI <armando.visconti@st.com>
Subject: Re: [patch] thermal: spear13xx: checking for NULL instead of IS_ERR()
Date: Wed, 29 Feb 2012 12:04:01 +0530	[thread overview]
Message-ID: <4F4DC6D9.7050204@st.com> (raw)
In-Reply-To: <20120229063151.GA18031@elgon.mountain>

On 2/29/2012 12:01 PM, Dan Carpenter wrote:
> thermal_zone_device_register() never returns NULL, on error it returns
> and ERR_PTR().
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
> index 880bf28..7352cf8 100644
> --- a/drivers/thermal/spear_thermal.c
> +++ b/drivers/thermal/spear_thermal.c
> @@ -149,9 +149,9 @@ static int spear_thermal_probe(struct platform_device *pdev)
>  
>  	spear_thermal = thermal_zone_device_register("spear_thermal", 0,
>  				stdev, &ops, 0, 0, 0, 0);
> -	if (!spear_thermal) {
> +	if (IS_ERR(spear_thermal)) {
>  		dev_err(&pdev->dev, "thermal zone device is NULL\n");
> -		ret = -EINVAL;
> +		ret = PTR_ERR(spear_thermal);
>  		goto disable_clk;
>  	}
>  

Thanks.

Reviewed-by: Viresh Kumar <viresh.kumar@st.com>

-- 
viresh

  reply	other threads:[~2012-02-29  6:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-29  6:31 [patch] thermal: spear13xx: checking for NULL instead of IS_ERR() Dan Carpenter
2012-02-29  6:31 ` Dan Carpenter
2012-02-29  6:34 ` Viresh Kumar [this message]
2012-02-29  6:46   ` Viresh Kumar
2012-02-29  9:02 ` Vincenzo Frascino
2012-02-29  9:02   ` Vincenzo Frascino

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=4F4DC6D9.7050204@st.com \
    --to=viresh.kumar@st.com \
    --cc=Vincenzo.FRASCINO@st.com \
    --cc=akpm@linux-foundation.org \
    --cc=armando.visconti@st.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shiraz.hashim@st.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.