summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/light
diff options
context:
space:
mode:
authorBrian Masney2018-04-21 02:41:45 +0200
committerJonathan Cameron2018-04-28 17:17:59 +0200
commit0ba50bef8f1a3a7aec1eac838eac2ff879d710a1 (patch)
tree2d3effaca8e5d054c026b2a162125f24f92850b8 /drivers/staging/iio/light
parentstaging: iio: tsl2x7x: simplify tsl2x7x_clear_interrupts function (diff)
downloadkernel-qcow2-linux-0ba50bef8f1a3a7aec1eac838eac2ff879d710a1.tar.gz
kernel-qcow2-linux-0ba50bef8f1a3a7aec1eac838eac2ff879d710a1.tar.xz
kernel-qcow2-linux-0ba50bef8f1a3a7aec1eac838eac2ff879d710a1.zip
staging: iio: tsl2x7x: remove unnecessary chip status checks in suspend/resume
tsl2x7x_suspend() and tsl2x7x_resume() both check to see what the current chip status is. These checks are not necessary so this patch removes those checks. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/staging/iio/light')
-rw-r--r--drivers/staging/iio/light/tsl2x7x.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c
index bc884dca4f41..21286b2b71b5 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -1690,27 +1690,15 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
static int tsl2x7x_suspend(struct device *dev)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
- struct tsl2X7X_chip *chip = iio_priv(indio_dev);
- int ret = 0;
-
- if (chip->tsl2x7x_chip_status == TSL2X7X_CHIP_WORKING) {
- ret = tsl2x7x_chip_off(indio_dev);
- chip->tsl2x7x_chip_status = TSL2X7X_CHIP_SUSPENDED;
- }
- return ret;
+ return tsl2x7x_chip_off(indio_dev);
}
static int tsl2x7x_resume(struct device *dev)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
- struct tsl2X7X_chip *chip = iio_priv(indio_dev);
- int ret = 0;
- if (chip->tsl2x7x_chip_status == TSL2X7X_CHIP_SUSPENDED)
- ret = tsl2x7x_chip_on(indio_dev);
-
- return ret;
+ return tsl2x7x_chip_on(indio_dev);
}
static int tsl2x7x_remove(struct i2c_client *client)