public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] thermal: spear13xx: checking for NULL instead of IS_ERR()
@ 2012-02-29  6:31 Dan Carpenter
  2012-02-29  6:34 ` Viresh Kumar
  2012-02-29  9:02 ` Vincenzo Frascino
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2012-02-29  6:31 UTC (permalink / raw)
  To: Vincenzo Frascino
  Cc: Andrew Morton, Viresh Kumar, linux-kernel, kernel-janitors

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;
 	}
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] thermal: spear13xx: checking for NULL instead of IS_ERR()
  2012-02-29  6:31 [patch] thermal: spear13xx: checking for NULL instead of IS_ERR() Dan Carpenter
@ 2012-02-29  6:34 ` Viresh Kumar
  2012-02-29  9:02 ` Vincenzo Frascino
  1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2012-02-29  6:34 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Vincenzo FRASCINO, Andrew Morton, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org, Shiraz HASHIM, Armando VISCONTI

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] thermal: spear13xx: checking for NULL instead of IS_ERR()
  2012-02-29  6:31 [patch] thermal: spear13xx: checking for NULL instead of IS_ERR() Dan Carpenter
  2012-02-29  6:34 ` Viresh Kumar
@ 2012-02-29  9:02 ` Vincenzo Frascino
  1 sibling, 0 replies; 3+ messages in thread
From: Vincenzo Frascino @ 2012-02-29  9:02 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Andrew Morton, Viresh KUMAR, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org

Thanks Dan.

Il 29/02/2012 07:31, Dan Carpenter ha scritto:
> 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;
>  	}
>  

Reviewed-by: Vincenzo Frascino <vincenzo.frascino@st.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-29  8:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-29  6:31 [patch] thermal: spear13xx: checking for NULL instead of IS_ERR() Dan Carpenter
2012-02-29  6:34 ` Viresh Kumar
2012-02-29  9:02 ` Vincenzo Frascino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox