linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] iio: Fix tmp006 dev-to-indio_dev conversion in suspend/resume
@ 2013-09-18 21:47 Peter Meerwald
  2013-09-18 21:47 ` [PATCH 2/4] iio: Fix bma180 " Peter Meerwald
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Peter Meerwald @ 2013-09-18 21:47 UTC (permalink / raw)
  To: linux-iio; +Cc: Peter Meerwald

dev_to_iio_dev() is a false friend

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
---
 drivers/iio/temperature/tmp006.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/temperature/tmp006.c b/drivers/iio/temperature/tmp006.c
index 4e95097..84a0789 100644
--- a/drivers/iio/temperature/tmp006.c
+++ b/drivers/iio/temperature/tmp006.c
@@ -252,12 +252,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);
 }
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-09-21 10:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-18 21:47 [PATCH 1/4] iio: Fix tmp006 dev-to-indio_dev conversion in suspend/resume Peter Meerwald
2013-09-18 21:47 ` [PATCH 2/4] iio: Fix bma180 " Peter Meerwald
2013-09-21 11:06   ` Jonathan Cameron
2013-09-18 21:47 ` [PATCH 3/4] iio: Fix mcp4725 " Peter Meerwald
2013-09-21 11:06   ` Jonathan Cameron
2013-09-18 21:47 ` [PATCH 4/4] iio: Fix tcs3472 " Peter Meerwald
2013-09-21 11:20   ` Jonathan Cameron
2013-09-21 11:05 ` [PATCH 1/4] iio: Fix tmp006 " Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).