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

lidar_i2c_xfer() function was never a non-positive value on error,
and this correct that with a -EIO return code.

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

diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
index 93e29fb..db35e04 100644
--- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
+++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
@@ -87,7 +87,7 @@ static int lidar_i2c_xfer(struct lidar_data *data, u8 reg, u8 *val, int len)
 
 	ret = i2c_transfer(client->adapter, msg, 2);
 
-	return (ret == 2) ? 0 : ret;
+	return (ret == 2) ? 0 : -EIO;
 }
 
 static int lidar_smbus_xfer(struct lidar_data *data, u8 reg, u8 *val, int len)
-- 
2.6.4

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

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

On 27/12/15 04:56, Matt Ranostay wrote:
> lidar_i2c_xfer() function was never a non-positive value on error,
> and this correct that with a -EIO return code.
> 
> Signed-off-by: Matt Ranostay <mranostay@gmail.com>

Hmm. Awkward timing on this one.  I'll create a temporary fix
branch for post the merge window closing and send it on to
Greg when appropriate.

This patch could have done with a fixes tag to avoid me having
to look up when this problem was introduced i.e.
Fixes: 366e65633cf4 ("iio: proximity: lidar: optimize i2c transactions")

> ---
>  drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
> index 93e29fb..db35e04 100644
> --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
> +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
> @@ -87,7 +87,7 @@ static int lidar_i2c_xfer(struct lidar_data *data, u8 reg, u8 *val, int len)
>  
>  	ret = i2c_transfer(client->adapter, msg, 2);
>  
> -	return (ret == 2) ? 0 : ret;
> +	return (ret == 2) ? 0 : -EIO;
>  }
>  
>  static int lidar_smbus_xfer(struct lidar_data *data, u8 reg, u8 *val, int len)
> 


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

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

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