Skip to content

Commit

Permalink
tsl2563: fixed bug with disabling interrupts
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Derek Basehore authored and Jonathan Cameron committed Nov 17, 2012
1 parent e3db9ef commit 95273f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/iio/light/tsl2563.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 95273f8

Please sign in to comment.