linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: adc: mxs-lradc: Checking IS_ERR() instead of NULL
@ 2017-04-26 21:03 Dan Carpenter
  2017-04-27  6:21 ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2017-04-26 21:03 UTC (permalink / raw)
  To: Jonathan Cameron, Ksenija Stanojevic
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Lee Jones, Marek Vasut, linux-iio, kernel-janitors

devm_ioremap() returns NULL on error.  It doesn't return error pointers.

Fixes: 6dd112b9f85e ("iio: adc: mxs-lradc: Add support for ADC driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/iio/adc/mxs-lradc-adc.c b/drivers/iio/adc/mxs-lradc-adc.c
index b0c7d8ee5cb8..493e2a26415d 100644
--- a/drivers/iio/adc/mxs-lradc-adc.c
+++ b/drivers/iio/adc/mxs-lradc-adc.c
@@ -719,8 +719,8 @@ static int mxs_lradc_adc_probe(struct platform_device *pdev)
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	adc->base = devm_ioremap(dev, iores->start, resource_size(iores));
-	if (IS_ERR(adc->base))
-		return PTR_ERR(adc->base);
+	if (!adc->base)
+		return -ENOMEM;
 
 	init_completion(&adc->completion);
 	spin_lock_init(&adc->lock);

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

* Re: [PATCH] iio: adc: mxs-lradc: Checking IS_ERR() instead of NULL
  2017-04-26 21:03 [PATCH] iio: adc: mxs-lradc: Checking IS_ERR() instead of NULL Dan Carpenter
@ 2017-04-27  6:21 ` Jonathan Cameron
  2017-06-13  8:39   ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2017-04-27  6:21 UTC (permalink / raw)
  To: Dan Carpenter, Ksenija Stanojevic
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Lee Jones, Marek Vasut, linux-iio, kernel-janitors

On 26/04/17 22:03, Dan Carpenter wrote:
> devm_ioremap() returns NULL on error.  It doesn't return error pointers.
> 
> Fixes: 6dd112b9f85e ("iio: adc: mxs-lradc: Add support for ADC driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
Hi Dan,

Already another patch for this under review.  Open question there is whether
devm_ioremap_resource is the way to go instead.

Jonathan
> diff --git a/drivers/iio/adc/mxs-lradc-adc.c b/drivers/iio/adc/mxs-lradc-adc.c
> index b0c7d8ee5cb8..493e2a26415d 100644
> --- a/drivers/iio/adc/mxs-lradc-adc.c
> +++ b/drivers/iio/adc/mxs-lradc-adc.c
> @@ -719,8 +719,8 @@ static int mxs_lradc_adc_probe(struct platform_device *pdev)
>  
>  	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	adc->base = devm_ioremap(dev, iores->start, resource_size(iores));
> -	if (IS_ERR(adc->base))
> -		return PTR_ERR(adc->base);
> +	if (!adc->base)
> +		return -ENOMEM;
>  
>  	init_completion(&adc->completion);
>  	spin_lock_init(&adc->lock);
> --
> 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: mxs-lradc: Checking IS_ERR() instead of NULL
  2017-04-27  6:21 ` Jonathan Cameron
@ 2017-06-13  8:39   ` Dan Carpenter
  2017-06-21 19:15     ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2017-06-13  8:39 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Ksenija Stanojevic, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Lee Jones, Marek Vasut, linux-iio,
	kernel-janitors

On Thu, Apr 27, 2017 at 07:21:09AM +0100, Jonathan Cameron wrote:
> On 26/04/17 22:03, Dan Carpenter wrote:
> > devm_ioremap() returns NULL on error.  It doesn't return error pointers.
> > 
> > Fixes: 6dd112b9f85e ("iio: adc: mxs-lradc: Add support for ADC driver")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> Hi Dan,
> 
> Already another patch for this under review.  Open question there is whether
> devm_ioremap_resource is the way to go instead.
> 

I wasn't on that other thread...  Nothing appears to have happened with
this or the touchscreen bug either.

regards,
dan carpenter

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

* Re: [PATCH] iio: adc: mxs-lradc: Checking IS_ERR() instead of NULL
  2017-06-13  8:39   ` Dan Carpenter
@ 2017-06-21 19:15     ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2017-06-21 19:15 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Ksenija Stanojevic, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Lee Jones, Marek Vasut, linux-iio,
	kernel-janitors

On Tue, 13 Jun 2017 11:39:05 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> On Thu, Apr 27, 2017 at 07:21:09AM +0100, Jonathan Cameron wrote:
> > On 26/04/17 22:03, Dan Carpenter wrote:  
> > > devm_ioremap() returns NULL on error.  It doesn't return error pointers.
> > > 
> > > Fixes: 6dd112b9f85e ("iio: adc: mxs-lradc: Add support for ADC driver")
> > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > >   
> > Hi Dan,
> > 
> > Already another patch for this under review.  Open question there is whether
> > devm_ioremap_resource is the way to go instead.
> >   
> 
> I wasn't on that other thread...  Nothing appears to have happened with
> this or the touchscreen bug either.
> 
> regards,
> dan carpenter
I think I was just being a bit lax in actually pushing it out and sending
Greg a pull request. 

https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?h=fixes-togreg&id=1454e15bc28ba94aa5d6b31a83a42d5c03af2a6d

Thanks for following up on this.

Jonathan
> 
> 


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

end of thread, other threads:[~2017-06-21 19:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-26 21:03 [PATCH] iio: adc: mxs-lradc: Checking IS_ERR() instead of NULL Dan Carpenter
2017-04-27  6:21 ` Jonathan Cameron
2017-06-13  8:39   ` Dan Carpenter
2017-06-21 19:15     ` Jonathan Cameron

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).