diff options
| -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) | |||
| 255 | #ifdef CONFIG_PM_SLEEP | 255 | #ifdef CONFIG_PM_SLEEP |
| 256 | static int tmp006_suspend(struct device *dev) | 256 | static int tmp006_suspend(struct device *dev) |
| 257 | { | 257 | { |
| 258 | return tmp006_powerdown(iio_priv(dev_to_iio_dev(dev))); | 258 | struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); |
| 259 | return tmp006_powerdown(iio_priv(indio_dev)); | ||
| 259 | } | 260 | } |
| 260 | 261 | ||
| 261 | static int tmp006_resume(struct device *dev) | 262 | static int tmp006_resume(struct device *dev) |
| 262 | { | 263 | { |
| 263 | struct tmp006_data *data = iio_priv(dev_to_iio_dev(dev)); | 264 | struct tmp006_data *data = iio_priv(i2c_get_clientdata( |
| 265 | to_i2c_client(dev))); | ||
| 264 | return i2c_smbus_write_word_swapped(data->client, TMP006_CONFIG, | 266 | return i2c_smbus_write_word_swapped(data->client, TMP006_CONFIG, |
| 265 | data->config | TMP006_CONFIG_MOD_MASK); | 267 | data->config | TMP006_CONFIG_MOD_MASK); |
| 266 | } | 268 | } |
