All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Derek Basehore <dbasehore@chromium.org>
Cc: jic23@cam.ac.uk, bleung@chromium.org,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	Jon Brenner - TAOS <jbrenner@taosinc.com>
Subject: Re: [PATCH] tsl2563: fixed bug with disabling interrupts
Date: Sat, 20 Oct 2012 10:49:18 +0100	[thread overview]
Message-ID: <5082739E.1000800@kernel.org> (raw)
In-Reply-To: <1349394896-4856-1-git-send-email-dbasehore@chromium.org>

cc'd iio mailing list and Jon Brenner.
Being lazy I haven't dug out the datahsheet to check this (my board has a broken
track to the interrupt line so can't easily test this!)

> In tsl_2563_write_interrupt_config and tsl2562_remove, interrupts are not
> disabled where they should be. This seems to be from a mistake of using |=
> instead of &= in 2 lines of code.
> 
> Signed-off-by: Derek Basehore <dbasehore@chromium.org>
> ---
>  drivers/staging/iio/light/tsl2563.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/light/tsl2563.c b/drivers/staging/iio/light/tsl2563.c
> index 954ca2c..3f72543 100644
> --- a/drivers/staging/iio/light/tsl2563.c
> +++ b/drivers/staging/iio/light/tsl2563.c
> @@ -652,7 +652,7 @@ static int tsl2563_write_interrupt_config(struct iio_dev *indio_dev,
>  	}
>  
>  	if (!state && (chip->intr & 0x30)) {
> -		chip->intr |= ~0x30;
> +		chip->intr &= ~0x30;
>  		ret = i2c_smbus_write_byte_data(chip->client,
>  						TSL2563_CMD | TSL2563_REG_INT,
>  						chip->intr);
> @@ -814,7 +814,7 @@ static int __devexit tsl2563_remove(struct i2c_client *client)
>  	if (!chip->int_enabled)
>  		cancel_delayed_work(&chip->poweroff_work);
>  	/* Ensure that interrupts are disabled - then flush any bottom halves */
> -	chip->intr |= ~0x30;
> +	chip->intr &= ~0x30;
>  	i2c_smbus_write_byte_data(chip->client, TSL2563_CMD | TSL2563_REG_INT,
>  				  chip->intr);
>  	flush_scheduled_work();
> 

       reply	other threads:[~2012-10-20  9:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1349394896-4856-1-git-send-email-dbasehore@chromium.org>
2012-10-20  9:49 ` Jonathan Cameron [this message]
2012-10-23 21:47   ` [PATCH] tsl2563: fixed bug with disabling interrupts Derek Basehore

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=5082739E.1000800@kernel.org \
    --to=jic23@kernel.org \
    --cc=bleung@chromium.org \
    --cc=dbasehore@chromium.org \
    --cc=jbrenner@taosinc.com \
    --cc=jic23@cam.ac.uk \
    --cc=linux-iio@vger.kernel.org \
    /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.