[PATCH] iio: chemical: vz89x: correct xfer return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux