All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: chemical: vz89x: correct xfer return value
@ 2015-12-27  5:11 Matt Ranostay
  2016-01-03 17:57 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Ranostay @ 2015-12-27  5:11 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, Matt Ranostay

vz89x_i2c_xfer() function was never returning a non-positive value on
error, and this patch corrects that with a -EIO return code.

Also the error condition was incorrect since it was against measurement
size and not the i2c messages send/received count.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
---
 drivers/iio/chemical/vz89x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/chemical/vz89x.c b/drivers/iio/chemical/vz89x.c
index c3367aa..0666919 100644
--- a/drivers/iio/chemical/vz89x.c
+++ b/drivers/iio/chemical/vz89x.c
@@ -120,7 +120,7 @@ static int vz89x_i2c_xfer(struct vz89x_data *data, u8 cmd)
 
 	ret = i2c_transfer(client->adapter, msg, 2);
 
-	return (ret == VZ89X_REG_MEASUREMENT_SIZE) ? 0 : ret;
+	return (ret == 2) ? 0 : -EIO;
 }
 
 static int vz89x_smbus_xfer(struct vz89x_data *data, u8 cmd)
-- 
2.6.4


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

* Re: [PATCH] iio: chemical: vz89x: correct xfer return value
  2015-12-27  5:11 [PATCH] iio: chemical: vz89x: correct xfer return value Matt Ranostay
@ 2016-01-03 17:57 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2016-01-03 17:57 UTC (permalink / raw)
  To: Matt Ranostay; +Cc: linux-iio

On 27/12/15 05:11, Matt Ranostay wrote:
> vz89x_i2c_xfer() function was never returning a non-positive value on
> error, and this patch corrects that with a -EIO return code.
> 
> Also the error condition was incorrect since it was against measurement
> size and not the i2c messages send/received count.
> 
> Signed-off-by: Matt Ranostay <mranostay@gmail.com>
This doesn't apply to the current tree as we already have
an 'incorrect' fix in place for the value being compared against below.

J
> ---
>  drivers/iio/chemical/vz89x.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/chemical/vz89x.c b/drivers/iio/chemical/vz89x.c
> index c3367aa..0666919 100644
> --- a/drivers/iio/chemical/vz89x.c
> +++ b/drivers/iio/chemical/vz89x.c
> @@ -120,7 +120,7 @@ static int vz89x_i2c_xfer(struct vz89x_data *data, u8 cmd)
>  
>  	ret = i2c_transfer(client->adapter, msg, 2);
>  
> -	return (ret == VZ89X_REG_MEASUREMENT_SIZE) ? 0 : ret;
> +	return (ret == 2) ? 0 : -EIO;
>  }
>  
>  static int vz89x_smbus_xfer(struct vz89x_data *data, u8 cmd)
> 


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

end of thread, other threads:[~2016-01-03 17:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-27  5:11 [PATCH] iio: chemical: vz89x: correct xfer return value Matt Ranostay
2016-01-03 17:57 ` 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.