diff options
Diffstat (limited to 'drivers/iio/dac/mcp4725.c')
-rw-r--r-- | drivers/iio/dac/mcp4725.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c index 6711a33b16ba..7a42d85269bb 100644 --- a/drivers/iio/dac/mcp4725.c +++ b/drivers/iio/dac/mcp4725.c | |||
@@ -37,21 +37,21 @@ struct mcp4725_data { | |||
37 | 37 | ||
38 | static int mcp4725_suspend(struct device *dev) | 38 | static int mcp4725_suspend(struct device *dev) |
39 | { | 39 | { |
40 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); | 40 | struct mcp4725_data *data = iio_priv(i2c_get_clientdata( |
41 | struct mcp4725_data *data = iio_priv(indio_dev); | 41 | to_i2c_client(dev))); |
42 | u8 outbuf[2]; | 42 | u8 outbuf[2]; |
43 | 43 | ||
44 | outbuf[0] = (data->powerdown_mode + 1) << 4; | 44 | outbuf[0] = (data->powerdown_mode + 1) << 4; |
45 | outbuf[1] = 0; | 45 | outbuf[1] = 0; |
46 | data->powerdown = true; | 46 | data->powerdown = true; |
47 | 47 | ||
48 | return i2c_master_send(to_i2c_client(dev), outbuf, 2); | 48 | return i2c_master_send(data->client, outbuf, 2); |
49 | } | 49 | } |
50 | 50 | ||
51 | static int mcp4725_resume(struct device *dev) | 51 | static int mcp4725_resume(struct device *dev) |
52 | { | 52 | { |
53 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); | 53 | struct mcp4725_data *data = iio_priv(i2c_get_clientdata( |
54 | struct mcp4725_data *data = iio_priv(indio_dev); | 54 | to_i2c_client(dev))); |
55 | u8 outbuf[2]; | 55 | u8 outbuf[2]; |
56 | 56 | ||
57 | /* restore previous DAC value */ | 57 | /* restore previous DAC value */ |
@@ -59,7 +59,7 @@ static int mcp4725_resume(struct device *dev) | |||
59 | outbuf[1] = data->dac_value & 0xff; | 59 | outbuf[1] = data->dac_value & 0xff; |
60 | data->powerdown = false; | 60 | data->powerdown = false; |
61 | 61 | ||
62 | return i2c_master_send(to_i2c_client(dev), outbuf, 2); | 62 | return i2c_master_send(data->client, outbuf, 2); |
63 | } | 63 | } |
64 | 64 | ||
65 | #ifdef CONFIG_PM_SLEEP | 65 | #ifdef CONFIG_PM_SLEEP |