diff options
author | Brian Masney <masneyb@onstation.org> | 2016-11-12 13:19:18 -0500 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-11-13 13:07:18 +0000 |
commit | 2ff8a35bd79e5a67137f6201b7d44515f19cf726 (patch) | |
tree | 8f8c9ab8c7b2a98153a13448467575a36c7f2532 /drivers/staging/iio | |
parent | 6a77e3f65130ad0fbc9b305e93efca59202b3626 (diff) | |
download | linux-2ff8a35bd79e5a67137f6201b7d44515f19cf726.tar.bz2 |
staging: iio: tsl2583: remove unnecessary chip status checks in suspend/resume
The device probing and the suspend/resume code checks a flag internal to
the driver that determines whether or not the chip is in a working
state. These checks are not needed. This patch removes the unnecessary
checks. It will do no harm to the hardware if the chip is
reinitialized if it is already powered on.
Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r-- | drivers/staging/iio/light/tsl2583.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c index a550023fa910..40aa78e8c867 100644 --- a/drivers/staging/iio/light/tsl2583.c +++ b/drivers/staging/iio/light/tsl2583.c @@ -412,13 +412,6 @@ static int tsl2583_chip_init_and_power_on(struct iio_dev *indio_dev) struct tsl2583_chip *chip = iio_priv(indio_dev); int ret; - /* and make sure we're not already on */ - if (chip->taos_chip_status == TSL258X_CHIP_WORKING) { - /* if forcing a register update - turn off, then on */ - dev_info(&chip->client->dev, "device is already enabled\n"); - return -EINVAL; - } - /* Power on the device; ADC off. */ ret = tsl2583_set_power_state(chip, TSL258X_CNTL_PWR_ON); if (ret < 0) @@ -841,10 +834,8 @@ static int __maybe_unused taos_suspend(struct device *dev) mutex_lock(&chip->als_mutex); - if (chip->taos_chip_status == TSL258X_CHIP_WORKING) { - ret = tsl2583_set_power_state(chip, TSL258X_CNTL_PWR_OFF); - chip->taos_chip_status = TSL258X_CHIP_SUSPENDED; - } + ret = tsl2583_set_power_state(chip, TSL258X_CNTL_PWR_OFF); + chip->taos_chip_status = TSL258X_CHIP_SUSPENDED; mutex_unlock(&chip->als_mutex); return ret; @@ -858,8 +849,7 @@ static int __maybe_unused taos_resume(struct device *dev) mutex_lock(&chip->als_mutex); - if (chip->taos_chip_status == TSL258X_CHIP_SUSPENDED) - ret = tsl2583_chip_init_and_power_on(indio_dev); + ret = tsl2583_chip_init_and_power_on(indio_dev); mutex_unlock(&chip->als_mutex); return ret; |