diff options
author | Peter Meerwald <pmeerw@pmeerw.net> | 2013-09-18 23:47:00 +0200 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-09-21 13:03:02 +0200 |
commit | d320f1b4811564052d5e3496a807a68c5ade791d (patch) | |
tree | fc59b8a8b76896d6f16d8aec3c07da1b2edc6a89 /drivers | |
parent | iio: iio_device_add_event_sysfs() bugfix (diff) | |
download | linux-d320f1b4811564052d5e3496a807a68c5ade791d.tar.xz linux-d320f1b4811564052d5e3496a807a68c5ade791d.zip |
iio: Fix tmp006 dev-to-indio_dev conversion in suspend/resume
dev_to_iio_dev() is a false friend
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iio/temperature/tmp006.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/iio/temperature/tmp006.c b/drivers/iio/temperature/tmp006.c index 64ccde3f1f7a..6d63883da1ab 100644 --- a/drivers/iio/temperature/tmp006.c +++ b/drivers/iio/temperature/tmp006.c @@ -255,12 +255,14 @@ static int tmp006_remove(struct i2c_client *client) #ifdef CONFIG_PM_SLEEP static int tmp006_suspend(struct device *dev) { - return tmp006_powerdown(iio_priv(dev_to_iio_dev(dev))); + struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); + return tmp006_powerdown(iio_priv(indio_dev)); } static int tmp006_resume(struct device *dev) { - struct tmp006_data *data = iio_priv(dev_to_iio_dev(dev)); + struct tmp006_data *data = iio_priv(i2c_get_clientdata( + to_i2c_client(dev))); return i2c_smbus_write_word_swapped(data->client, TMP006_CONFIG, data->config | TMP006_CONFIG_MOD_MASK); } |