Skip to content

Commit

Permalink
iio: Fix tmp006 dev-to-indio_dev conversion in suspend/resume
Browse files Browse the repository at this point in the history
dev_to_iio_dev() is a false friend

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Peter Meerwald authored and Jonathan Cameron committed Sep 21, 2013
1 parent 2b0774d commit d320f1b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/iio/temperature/tmp006.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit d320f1b

Please sign in to comment.