aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2013-06-05 10:13:47 -0400
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>2013-06-12 11:58:59 -0400
commita9bce1b03c2199e66d36cda8aac675338bc074a7 (patch)
tree1f02ee8522388834c2a31de21dd8b7b38409f457 /drivers/iio
parentd683b96b072dc4680fc74964eca77e6a23d1fa6e (diff)
mfd: input: iio: ti_am335x_adc: use one structure for ti_tscadc_dev
The mfd driver creates platform data for the child devices and it is the ti_tscadc_dev struct. This struct is copied for the two devices. The copy of the structure makes a common lock in this structure a little less usefull. Therefore the platform data is not a pointer to the structure and the same structure is used. While doing the change I noticed that the suspend/resume code assumes the wrong pointer for ti_tscadc_dev and this has been fixed as well. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/ti_am335x_adc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
index 5f9a7e7d3135..9db352e413e4 100644
--- a/drivers/iio/adc/ti_am335x_adc.c
+++ b/drivers/iio/adc/ti_am335x_adc.c
@@ -140,7 +140,7 @@ static int tiadc_probe(struct platform_device *pdev)
140{ 140{
141 struct iio_dev *indio_dev; 141 struct iio_dev *indio_dev;
142 struct tiadc_device *adc_dev; 142 struct tiadc_device *adc_dev;
143 struct ti_tscadc_dev *tscadc_dev = pdev->dev.platform_data; 143 struct ti_tscadc_dev *tscadc_dev = ti_tscadc_dev_get(pdev);
144 struct mfd_tscadc_board *pdata; 144 struct mfd_tscadc_board *pdata;
145 int err; 145 int err;
146 146
@@ -205,9 +205,10 @@ static int tiadc_suspend(struct device *dev)
205{ 205{
206 struct iio_dev *indio_dev = dev_get_drvdata(dev); 206 struct iio_dev *indio_dev = dev_get_drvdata(dev);
207 struct tiadc_device *adc_dev = iio_priv(indio_dev); 207 struct tiadc_device *adc_dev = iio_priv(indio_dev);
208 struct ti_tscadc_dev *tscadc_dev = dev->platform_data; 208 struct ti_tscadc_dev *tscadc_dev;
209 unsigned int idle; 209 unsigned int idle;
210 210
211 tscadc_dev = ti_tscadc_dev_get(to_platform_device(dev));
211 if (!device_may_wakeup(tscadc_dev->dev)) { 212 if (!device_may_wakeup(tscadc_dev->dev)) {
212 idle = tiadc_readl(adc_dev, REG_CTRL); 213 idle = tiadc_readl(adc_dev, REG_CTRL);
213 idle &= ~(CNTRLREG_TSCSSENB); 214 idle &= ~(CNTRLREG_TSCSSENB);