Commit 0ba50bef authored by Brian Masney's avatar Brian Masney Committed by Jonathan Cameron

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: default avatarBrian Masney <masneyb@onstation.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent d8e24a31
...@@ -1690,27 +1690,15 @@ static int tsl2x7x_probe(struct i2c_client *clientp, ...@@ -1690,27 +1690,15 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
static int tsl2x7x_suspend(struct device *dev) static int tsl2x7x_suspend(struct device *dev)
{ {
struct iio_dev *indio_dev = dev_get_drvdata(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) static int tsl2x7x_resume(struct device *dev)
{ {
struct iio_dev *indio_dev = dev_get_drvdata(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) return tsl2x7x_chip_on(indio_dev);
ret = tsl2x7x_chip_on(indio_dev);
return ret;
} }
static int tsl2x7x_remove(struct i2c_client *client) static int tsl2x7x_remove(struct i2c_client *client)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment