From: Jonathan Cameron <jic23@kernel.org>
To: "Vianney le Clément de Saint-Marcq"
<vianney.leclement@essensium.com>,
linux-iio@vger.kernel.org
Cc: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
Subject: Re: [PATCH v2 7/7] iio: mlx90614: Check for errors in read values
Date: Sat, 28 Mar 2015 13:43:51 +0000 [thread overview]
Message-ID: <5516B017.8050409@kernel.org> (raw)
In-Reply-To: <1427212459-31585-8-git-send-email-vianney.leclement@essensium.com>
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@essensium.com>
> Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
>
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:
>
prev parent reply other threads:[~2015-03-28 13:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-24 15:54 [PATCH v2 0/7] iio: mlx90614 enhancements Vianney le Clément de Saint-Marcq
2015-03-24 15:54 ` Vianney le Clément de Saint-Marcq
2015-03-24 15:54 ` [PATCH v2 1/7] iio: mlx90614: Refactor register symbols Vianney le Clément de Saint-Marcq
2015-03-28 12:40 ` Jonathan Cameron
2015-03-24 15:54 ` [PATCH v2 2/7] iio: mlx90614: Add symbols for accessible registers Vianney le Clément de Saint-Marcq
2015-03-24 15:54 ` [PATCH v2 3/7] iio: mlx90614: Support devices with dual IR sensor Vianney le Clément de Saint-Marcq
2015-03-28 12:44 ` Jonathan Cameron
2015-03-24 15:54 ` [PATCH v2 4/7] iio: core: Introduce IIO_CHAN_INFO_EMISSIVITY Vianney le Clément de Saint-Marcq
2015-03-24 16:02 ` Lars-Peter Clausen
2015-03-28 12:45 ` Jonathan Cameron
2015-03-24 15:54 ` [PATCH v2 5/7] iio: mlx90614: Add emissivity setting Vianney le Clément de Saint-Marcq
2015-03-28 12:46 ` Jonathan Cameron
2015-03-24 15:54 ` [PATCH v2 6/7] iio: mlx90614: Add power management Vianney le Clément de Saint-Marcq
2015-03-24 15:54 ` Vianney le Clément de Saint-Marcq
2015-03-28 12:54 ` Jonathan Cameron
2015-03-28 12:54 ` Jonathan Cameron
2015-03-24 15:54 ` [PATCH v2 7/7] iio: mlx90614: Check for errors in read values Vianney le Clément de Saint-Marcq
2015-03-28 13:43 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5516B017.8050409@kernel.org \
--to=jic23@kernel.org \
--cc=arnout@mind.be \
--cc=linux-iio@vger.kernel.org \
--cc=vianney.leclement@essensium.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.