diff options
author | Peter Meerwald <pmeerw@pmeerw.net> | 2013-09-18 17:47:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-09-21 14:23:47 -0400 |
commit | 4caf279a285cb126023dde1386c6f1cebcfa7e29 (patch) | |
tree | 93e941be3d073c2ab9fdaf3bdd849c2632dff708 /drivers/iio/light | |
parent | ca9a563805f7ae821e3303b1bdbc65d3a3c783ff (diff) |
iio: Fix tcs3472 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/iio/light')
-rw-r--r-- | drivers/iio/light/tcs3472.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/iio/light/tcs3472.c b/drivers/iio/light/tcs3472.c index 7bf296943745..0b4ed57d746e 100644 --- a/drivers/iio/light/tcs3472.c +++ b/drivers/iio/light/tcs3472.c | |||
@@ -330,12 +330,15 @@ static int tcs3472_remove(struct i2c_client *client) | |||
330 | #ifdef CONFIG_PM_SLEEP | 330 | #ifdef CONFIG_PM_SLEEP |
331 | static int tcs3472_suspend(struct device *dev) | 331 | static int tcs3472_suspend(struct device *dev) |
332 | { | 332 | { |
333 | return tcs3472_powerdown(iio_priv(dev_to_iio_dev(dev))); | 333 | struct tcs3472_data *data = iio_priv(i2c_get_clientdata( |
334 | to_i2c_client(dev))); | ||
335 | return tcs3472_powerdown(data); | ||
334 | } | 336 | } |
335 | 337 | ||
336 | static int tcs3472_resume(struct device *dev) | 338 | static int tcs3472_resume(struct device *dev) |
337 | { | 339 | { |
338 | struct tcs3472_data *data = iio_priv(dev_to_iio_dev(dev)); | 340 | struct tcs3472_data *data = iio_priv(i2c_get_clientdata( |
341 | to_i2c_client(dev))); | ||
339 | return i2c_smbus_write_byte_data(data->client, TCS3472_ENABLE, | 342 | return i2c_smbus_write_byte_data(data->client, TCS3472_ENABLE, |
340 | data->enable | (TCS3472_ENABLE_AEN | TCS3472_ENABLE_PON)); | 343 | data->enable | (TCS3472_ENABLE_AEN | TCS3472_ENABLE_PON)); |
341 | } | 344 | } |