All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hartmut Knaack <knaack.h@gmx.de>
To: Vlad Dogaru <vlad.dogaru@intel.com>,
	linux-iio@vger.kernel.org, jic23@kernel.org
Subject: Re: [PATCH 2/2] iio: sx9500: fix bug in compensation code
Date: Wed, 01 Jul 2015 20:42:45 +0200	[thread overview]
Message-ID: <559434A5.3070900@gmx.de> (raw)
In-Reply-To: <1435663259-21998-3-git-send-email-vlad.dogaru@intel.com>

Vlad Dogaru schrieb am 30.06.2015 um 13:20:
> The initial compensation was mistakingly toggling an extra bit in the
> control register.  Fix this and make sure it's less likely to happen by
> introducing an additional macro.
> 
> Reported-by: Hartmut Knaack <knaack.h@gmx.de>
> Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
Acked-by: Hartmut Knaack <knaack.h@gmx.de>
> ---
>  drivers/iio/proximity/sx9500.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c
> index ba1cbbe..798b973 100644
> --- a/drivers/iio/proximity/sx9500.c
> +++ b/drivers/iio/proximity/sx9500.c
> @@ -80,6 +80,7 @@
>  #define SX9500_COMPSTAT_MASK		GENMASK(3, 0)
>  
>  #define SX9500_NUM_CHANNELS		4
> +#define SX9500_CHAN_MASK		GENMASK(SX9500_NUM_CHANNELS - 1, 0)
>  
>  struct sx9500_data {
>  	struct mutex mutex;
> @@ -802,8 +803,7 @@ static int sx9500_init_compensation(struct iio_dev *indio_dev)
>  	unsigned int val;
>  
>  	ret = regmap_update_bits(data->regmap, SX9500_REG_PROX_CTRL0,
> -				 GENMASK(SX9500_NUM_CHANNELS, 0),
> -				 GENMASK(SX9500_NUM_CHANNELS, 0));
> +				 SX9500_CHAN_MASK, SX9500_CHAN_MASK);
>  	if (ret < 0)
>  		return ret;
>  
> @@ -823,7 +823,7 @@ static int sx9500_init_compensation(struct iio_dev *indio_dev)
>  
>  out:
>  	regmap_update_bits(data->regmap, SX9500_REG_PROX_CTRL0,
> -			   GENMASK(SX9500_NUM_CHANNELS, 0), 0);
> +			   SX9500_CHAN_MASK, 0);
>  	return ret;
>  }
>  
> 

  reply	other threads:[~2015-07-01 18:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30 11:20 [PATCH 0/2] iio: sx9500: couple of bug fixes Vlad Dogaru
2015-06-30 11:20 ` [PATCH 1/2] iio: sx9500: rework error handling of raw readings Vlad Dogaru
2015-07-01 18:39   ` Hartmut Knaack
2015-07-05 13:02     ` Jonathan Cameron
2015-06-30 11:20 ` [PATCH 2/2] iio: sx9500: fix bug in compensation code Vlad Dogaru
2015-07-01 18:42   ` Hartmut Knaack [this message]
2015-07-05 13:04     ` Jonathan Cameron

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=559434A5.3070900@gmx.de \
    --to=knaack.h@gmx.de \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=vlad.dogaru@intel.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.