diff options
Diffstat (limited to 'drivers/iio/light/tsl2563.c')
-rw-r--r-- | drivers/iio/light/tsl2563.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c index 0a278eea36ca..bbb577459fb9 100644 --- a/drivers/iio/light/tsl2563.c +++ b/drivers/iio/light/tsl2563.c @@ -310,7 +310,7 @@ static int tsl2563_get_adc(struct tsl2563_chip *chip) goto out; if (!chip->int_enabled) { - cancel_delayed_work(&chip->poweroff_work); + cancel_delayed_work_sync(&chip->poweroff_work); if (!tsl2563_get_power(chip)) { ret = tsl2563_set_power(chip, 1); @@ -638,7 +638,7 @@ static int tsl2563_write_interrupt_config(struct iio_dev *indio_dev, chip->intr &= ~0x30; chip->intr |= 0x10; /* ensure the chip is actually on */ - cancel_delayed_work(&chip->poweroff_work); + cancel_delayed_work_sync(&chip->poweroff_work); if (!tsl2563_get_power(chip)) { ret = tsl2563_set_power(chip, 1); if (ret) @@ -803,12 +803,11 @@ static int tsl2563_remove(struct i2c_client *client) iio_device_unregister(indio_dev); if (!chip->int_enabled) - cancel_delayed_work(&chip->poweroff_work); + cancel_delayed_work_sync(&chip->poweroff_work); /* Ensure that interrupts are disabled - then flush any bottom halves */ chip->intr &= ~0x30; i2c_smbus_write_byte_data(chip->client, TSL2563_CMD | TSL2563_REG_INT, chip->intr); - flush_scheduled_work(); tsl2563_set_power(chip, 0); return 0; |