summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2012-08-10 20:36:00 +0400
committerJonathan Cameron <jic23@kernel.org>2012-08-27 20:47:35 +0400
commit49f8812e4d15970341f0ed320e78951cc16b596d (patch)
tree51ee7c356afa92275be5ecc2db1f50173f46a4c4
parentc8c194d5c21fc157c2329436e541bf8f33a2ee25 (diff)
downloadlinux-49f8812e4d15970341f0ed320e78951cc16b596d.tar.xz
staging:iio:ad7192: Remove unused platform_data from device state struct
The platform data for the device is only used from within the drivers probe callback, so there is no need to keep it around in the devices state struct. While we are at it mark the platform data struct as const. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--drivers/staging/iio/adc/ad7192.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index 405d9a8d7b6d..cdb4fc4ef820 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -136,7 +136,6 @@ struct ad7192_state {
struct spi_device *spi;
struct iio_trigger *trig;
struct regulator *reg;
- struct ad7192_platform_data *pdata;
wait_queue_head_t wq_data_avail;
bool done;
bool irq_dis;
@@ -347,10 +346,10 @@ out:
return ret;
}
-static int ad7192_setup(struct ad7192_state *st)
+static int ad7192_setup(struct ad7192_state *st,
+ const struct ad7192_platform_data *pdata)
{
struct iio_dev *indio_dev = spi_get_drvdata(st->spi);
- struct ad7192_platform_data *pdata = st->pdata;
unsigned long long scale_uv;
int i, ret, id;
u8 ones[6];
@@ -985,7 +984,7 @@ static const struct iio_chan_spec ad7192_channels[] = {
static int __devinit ad7192_probe(struct spi_device *spi)
{
- struct ad7192_platform_data *pdata = spi->dev.platform_data;
+ const struct ad7192_platform_data *pdata = spi->dev.platform_data;
struct ad7192_state *st;
struct iio_dev *indio_dev;
int ret , voltage_uv = 0;
@@ -1015,8 +1014,6 @@ static int __devinit ad7192_probe(struct spi_device *spi)
voltage_uv = regulator_get_voltage(st->reg);
}
- st->pdata = pdata;
-
if (pdata && pdata->vref_mv)
st->int_vref_mv = pdata->vref_mv;
else if (voltage_uv)
@@ -1047,7 +1044,7 @@ static int __devinit ad7192_probe(struct spi_device *spi)
if (ret)
goto error_ring_cleanup;
- ret = ad7192_setup(st);
+ ret = ad7192_setup(st, pdata);
if (ret)
goto error_remove_trigger;