Commit 4caf279a authored by Peter Meerwald's avatar Peter Meerwald Committed by Jonathan Cameron

iio: Fix tcs3472 dev-to-indio_dev conversion in suspend/resume

dev_to_iio_dev() is a false friend
Signed-off-by: default avatarPeter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent ca9a5638
...@@ -330,12 +330,15 @@ static int tcs3472_remove(struct i2c_client *client) ...@@ -330,12 +330,15 @@ static int tcs3472_remove(struct i2c_client *client)
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int tcs3472_suspend(struct device *dev) static int tcs3472_suspend(struct device *dev)
{ {
return tcs3472_powerdown(iio_priv(dev_to_iio_dev(dev))); struct tcs3472_data *data = iio_priv(i2c_get_clientdata(
to_i2c_client(dev)));
return tcs3472_powerdown(data);
} }
static int tcs3472_resume(struct device *dev) static int tcs3472_resume(struct device *dev)
{ {
struct tcs3472_data *data = iio_priv(dev_to_iio_dev(dev)); struct tcs3472_data *data = iio_priv(i2c_get_clientdata(
to_i2c_client(dev)));
return i2c_smbus_write_byte_data(data->client, TCS3472_ENABLE, return i2c_smbus_write_byte_data(data->client, TCS3472_ENABLE,
data->enable | (TCS3472_ENABLE_AEN | TCS3472_ENABLE_PON)); data->enable | (TCS3472_ENABLE_AEN | TCS3472_ENABLE_PON));
} }
......
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