All of lore.kernel.org
 help / color / mirror / Atom feed
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>,
	Peter Meerwald <pmeerw@pmeerw.net>
Subject: Re: [PATCH v3 5/5] iio: mlx90614: Check for errors in read values
Date: Thu, 09 Apr 2015 15:10:36 +0100	[thread overview]
Message-ID: <5526885C.8090904@kernel.org> (raw)
In-Reply-To: <1427704502-22347-6-git-send-email-vianney.leclement@essensium.com>

On 30/03/15 09:35, Vianney le Clément de Saint-Marcq wrote:
> The device uses the MSB of the returned temperature value 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>
Applied.
> 
> ---
> 
> v3: return -EIO instead of -EREMOTEIO
> 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 73ec767..06b7b96 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 -EIO;
> +
>  		*val = ret;
>  		return IIO_VAL_INT;
>  	case IIO_CHAN_INFO_OFFSET:
> 


      reply	other threads:[~2015-04-09 14:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-30  8:34 [PATCH v3 0/5] iio: mlx90614 enhancements Vianney le Clément de Saint-Marcq
2015-03-30  8:34 ` Vianney le Clément de Saint-Marcq
2015-03-30  8:34 ` [PATCH v3 1/5] iio: core: Introduce IIO_CHAN_INFO_CALIBEMISSIVITY Vianney le Clément de Saint-Marcq
2015-04-09 14:03   ` Jonathan Cameron
2015-03-30  8:35 ` [PATCH v3 3/5] iio: mlx90614: Add emissivity setting Vianney le Clément de Saint-Marcq
2015-04-09 14:07   ` Jonathan Cameron
     [not found] ` <1427704502-22347-1-git-send-email-vianney.leclement-buIOx9BAs4sybS5Ee8rs3A@public.gmane.org>
2015-03-30  8:34   ` [PATCH v3 2/5] iio: mlx90614: Add devicetree bindings documentation Vianney le Clément de Saint-Marcq
2015-03-30  8:34     ` Vianney le Clément de Saint-Marcq
     [not found]     ` <1427704502-22347-3-git-send-email-vianney.leclement-buIOx9BAs4sybS5Ee8rs3A@public.gmane.org>
2015-04-09 14:05       ` Jonathan Cameron
2015-04-09 14:05         ` Jonathan Cameron
2015-03-30  8:35   ` [PATCH v3 4/5] iio: mlx90614: Add power management Vianney le Clément de Saint-Marcq
2015-03-30  8:35     ` Vianney le Clément de Saint-Marcq
     [not found]     ` <1427704502-22347-5-git-send-email-vianney.leclement-buIOx9BAs4sybS5Ee8rs3A@public.gmane.org>
2015-04-09 14:09       ` Jonathan Cameron
2015-04-09 14:09         ` Jonathan Cameron
2015-03-30  8:35 ` [PATCH v3 5/5] iio: mlx90614: Check for errors in read values Vianney le Clément de Saint-Marcq
2015-04-09 14:10   ` 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=5526885C.8090904@kernel.org \
    --to=jic23@kernel.org \
    --cc=arnout@mind.be \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --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.