All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: adc: Max9611: checking for ERR_PTR instead of NULL in probe
@ 2017-04-20 10:26 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-04-20 10:26 UTC (permalink / raw)
  To: Jonathan Cameron, Jacopo Mondi
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, kernel-janitors

devm_iio_device_alloc() doesn't return ERR_PTRs, it returns NULLs.

Fixes: 69780a3bbc0b ("iio: adc: Add Maxim max9611 ADC driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c
index ec82106480e1..dc3869bf3248 100644
--- a/drivers/iio/adc/max9611.c
+++ b/drivers/iio/adc/max9611.c
@@ -536,8 +536,8 @@ static int max9611_probe(struct i2c_client *client,
 	int ret;
 
 	indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*max9611));
-	if (IS_ERR(indio_dev))
-		return PTR_ERR(indio_dev);
+	if (!indio_dev)
+		return -ENOMEM;
 
 	i2c_set_clientdata(client, indio_dev);
 

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

* [PATCH] iio: adc: Max9611: checking for ERR_PTR instead of NULL in probe
@ 2017-04-20 10:26 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-04-20 10:26 UTC (permalink / raw)
  To: Jonathan Cameron, Jacopo Mondi
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, kernel-janitors

devm_iio_device_alloc() doesn't return ERR_PTRs, it returns NULLs.

Fixes: 69780a3bbc0b ("iio: adc: Add Maxim max9611 ADC driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c
index ec82106480e1..dc3869bf3248 100644
--- a/drivers/iio/adc/max9611.c
+++ b/drivers/iio/adc/max9611.c
@@ -536,8 +536,8 @@ static int max9611_probe(struct i2c_client *client,
 	int ret;
 
 	indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*max9611));
-	if (IS_ERR(indio_dev))
-		return PTR_ERR(indio_dev);
+	if (!indio_dev)
+		return -ENOMEM;
 
 	i2c_set_clientdata(client, indio_dev);
 

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

* Re: [PATCH] iio: adc: Max9611: checking for ERR_PTR instead of NULL in probe
  2017-04-20 10:26 ` Dan Carpenter
@ 2017-04-26  6:25   ` Jonathan Cameron
  -1 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2017-04-26  6:25 UTC (permalink / raw)
  To: Dan Carpenter, Jacopo Mondi
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, kernel-janitors

On 20/04/17 11:26, Dan Carpenter wrote:
> devm_iio_device_alloc() doesn't return ERR_PTRs, it returns NULLs.
> 
> Fixes: 69780a3bbc0b ("iio: adc: Add Maxim max9611 ADC driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
Applied to the fixes-togreg branch of iio.git.  Will get this to
Greg soon after the merge window closes.

Thanks,

Jonathan
> diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c
> index ec82106480e1..dc3869bf3248 100644
> --- a/drivers/iio/adc/max9611.c
> +++ b/drivers/iio/adc/max9611.c
> @@ -536,8 +536,8 @@ static int max9611_probe(struct i2c_client *client,
>  	int ret;
>  
>  	indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*max9611));
> -	if (IS_ERR(indio_dev))
> -		return PTR_ERR(indio_dev);
> +	if (!indio_dev)
> +		return -ENOMEM;
>  
>  	i2c_set_clientdata(client, indio_dev);
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

* Re: [PATCH] iio: adc: Max9611: checking for ERR_PTR instead of NULL in probe
@ 2017-04-26  6:25   ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2017-04-26  6:25 UTC (permalink / raw)
  To: Dan Carpenter, Jacopo Mondi
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, kernel-janitors

On 20/04/17 11:26, Dan Carpenter wrote:
> devm_iio_device_alloc() doesn't return ERR_PTRs, it returns NULLs.
> 
> Fixes: 69780a3bbc0b ("iio: adc: Add Maxim max9611 ADC driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
Applied to the fixes-togreg branch of iio.git.  Will get this to
Greg soon after the merge window closes.

Thanks,

Jonathan
> diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c
> index ec82106480e1..dc3869bf3248 100644
> --- a/drivers/iio/adc/max9611.c
> +++ b/drivers/iio/adc/max9611.c
> @@ -536,8 +536,8 @@ static int max9611_probe(struct i2c_client *client,
>  	int ret;
>  
>  	indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*max9611));
> -	if (IS_ERR(indio_dev))
> -		return PTR_ERR(indio_dev);
> +	if (!indio_dev)
> +		return -ENOMEM;
>  
>  	i2c_set_clientdata(client, indio_dev);
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

end of thread, other threads:[~2017-04-26  6:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-20 10:26 [PATCH] iio: adc: Max9611: checking for ERR_PTR instead of NULL in probe Dan Carpenter
2017-04-20 10:26 ` Dan Carpenter
2017-04-26  6:25 ` Jonathan Cameron
2017-04-26  6:25   ` Jonathan Cameron

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.