On 24/03/15 15:54, Vianney le Clément de Saint-Marcq wrote: > The device uses the MSB of the returned temperature values as an error > flag. Return a read error when this bit is set. > > Signed-off-by: Vianney le Clément de Saint-Marcq <vianney.leclement@xxxxxxxxxxxxx> > Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@xxxxxxx> > Hmm. Does it really signify a remote IO issue. I'd have thought EIO was more appropriate. I see one -EREMOTEIO using driver (vybrid ADC) but in other similar cases we've always gone with EIO. J > --- > > v2: new patch > --- > drivers/iio/temperature/mlx90614.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/iio/temperature/mlx90614.c b/drivers/iio/temperature/mlx90614.c > index 6b9bfcd..6cb1e81 100644 > --- a/drivers/iio/temperature/mlx90614.c > +++ b/drivers/iio/temperature/mlx90614.c > @@ -196,6 +196,11 @@ static int mlx90614_read_raw(struct iio_dev *indio_dev, > > if (ret < 0) > return ret; > + > + /* MSB is an error flag */ > + if (ret & 0x8000) > + return -EREMOTEIO; > + > *val = ret; > return IIO_VAL_INT; > case IIO_CHAN_INFO_OFFSET: > -- 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