All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: adc: max1027: fix error code in max1027_wait_eoc()
@ 2021-10-04 13:44 Dan Carpenter
  2021-10-04 14:17 ` Miquel Raynal
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2021-10-04 13:44 UTC (permalink / raw)
  To: Jonathan Cameron, Miquel Raynal
  Cc: Lars-Peter Clausen, Nuno Sá, linux-iio, kernel-janitors

Return -ETIMEDOUT on timeout instead of success.

Fixes: 54f14be01e17 ("iio: adc: max1027: Use the EOC IRQ when populated for single reads")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/iio/adc/max1027.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
index 45dc8a625fa3..4daf1d576c4e 100644
--- a/drivers/iio/adc/max1027.c
+++ b/drivers/iio/adc/max1027.c
@@ -286,7 +286,7 @@ static int max1027_wait_eoc(struct iio_dev *indio_dev)
 						  msecs_to_jiffies(1000));
 		reinit_completion(&st->complete);
 		if (!ret)
-			return ret;
+			return -ETIMEDOUT;
 	} else {
 		if (indio_dev->active_scan_mask)
 			conversion_time *= hweight32(*indio_dev->active_scan_mask);
-- 
2.20.1


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

* Re: [PATCH] iio: adc: max1027: fix error code in max1027_wait_eoc()
  2021-10-04 13:44 [PATCH] iio: adc: max1027: fix error code in max1027_wait_eoc() Dan Carpenter
@ 2021-10-04 14:17 ` Miquel Raynal
  2021-10-04 19:31   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Miquel Raynal @ 2021-10-04 14:17 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jonathan Cameron, Lars-Peter Clausen, Nuno Sá,
	linux-iio, kernel-janitors

Hello,

dan.carpenter@oracle.com wrote on Mon, 4 Oct 2021 16:44:54 +0300:

> Return -ETIMEDOUT on timeout instead of success.
> 
> Fixes: 54f14be01e17 ("iio: adc: max1027: Use the EOC IRQ when populated for single reads")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/iio/adc/max1027.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
> index 45dc8a625fa3..4daf1d576c4e 100644
> --- a/drivers/iio/adc/max1027.c
> +++ b/drivers/iio/adc/max1027.c
> @@ -286,7 +286,7 @@ static int max1027_wait_eoc(struct iio_dev *indio_dev)
>  						  msecs_to_jiffies(1000));
>  		reinit_completion(&st->complete);
>  		if (!ret)
> -			return ret;
> +			return -ETIMEDOUT;

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

>  	} else {
>  		if (indio_dev->active_scan_mask)
>  			conversion_time *= hweight32(*indio_dev->active_scan_mask);


Thanks,
Miquèl

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

* Re: [PATCH] iio: adc: max1027: fix error code in max1027_wait_eoc()
  2021-10-04 14:17 ` Miquel Raynal
@ 2021-10-04 19:31   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2021-10-04 19:31 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Dan Carpenter, Lars-Peter Clausen, Nuno Sá,
	linux-iio, kernel-janitors

On Mon, 4 Oct 2021 16:17:11 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Hello,
> 
> dan.carpenter@oracle.com wrote on Mon, 4 Oct 2021 16:44:54 +0300:
> 
> > Return -ETIMEDOUT on timeout instead of success.
> > 
> > Fixes: 54f14be01e17 ("iio: adc: max1027: Use the EOC IRQ when populated for single reads")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> >  drivers/iio/adc/max1027.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
> > index 45dc8a625fa3..4daf1d576c4e 100644
> > --- a/drivers/iio/adc/max1027.c
> > +++ b/drivers/iio/adc/max1027.c
> > @@ -286,7 +286,7 @@ static int max1027_wait_eoc(struct iio_dev *indio_dev)
> >  						  msecs_to_jiffies(1000));
> >  		reinit_completion(&st->complete);
> >  		if (!ret)
> > -			return ret;
> > +			return -ETIMEDOUT;  
> 
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Applied to the togreg branch of iio.git.

As this is the only patch I've applied today I've just pushed it out directly
for next to pick up rather than going through the normal initial push to testing
for 0-day. 

Thanks,

Jonathan

> 
> >  	} else {
> >  		if (indio_dev->active_scan_mask)
> >  			conversion_time *= hweight32(*indio_dev->active_scan_mask);  
> 
> 
> Thanks,
> Miquèl


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

end of thread, other threads:[~2021-10-04 19:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-04 13:44 [PATCH] iio: adc: max1027: fix error code in max1027_wait_eoc() Dan Carpenter
2021-10-04 14:17 ` Miquel Raynal
2021-10-04 19:31   ` 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.