Skip to content

Commit 49f8812

Browse files
larsclausenjic23
authored andcommitted
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>
1 parent c8c194d commit 49f8812

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/staging/iio/adc/ad7192.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ struct ad7192_state {
136136
struct spi_device *spi;
137137
struct iio_trigger *trig;
138138
struct regulator *reg;
139-
struct ad7192_platform_data *pdata;
140139
wait_queue_head_t wq_data_avail;
141140
bool done;
142141
bool irq_dis;
@@ -347,10 +346,10 @@ static int ad7192_calibrate_all(struct ad7192_state *st)
347346
return ret;
348347
}
349348

350-
static int ad7192_setup(struct ad7192_state *st)
349+
static int ad7192_setup(struct ad7192_state *st,
350+
const struct ad7192_platform_data *pdata)
351351
{
352352
struct iio_dev *indio_dev = spi_get_drvdata(st->spi);
353-
struct ad7192_platform_data *pdata = st->pdata;
354353
unsigned long long scale_uv;
355354
int i, ret, id;
356355
u8 ones[6];
@@ -985,7 +984,7 @@ static const struct iio_chan_spec ad7192_channels[] = {
985984

986985
static int __devinit ad7192_probe(struct spi_device *spi)
987986
{
988-
struct ad7192_platform_data *pdata = spi->dev.platform_data;
987+
const struct ad7192_platform_data *pdata = spi->dev.platform_data;
989988
struct ad7192_state *st;
990989
struct iio_dev *indio_dev;
991990
int ret , voltage_uv = 0;
@@ -1015,8 +1014,6 @@ static int __devinit ad7192_probe(struct spi_device *spi)
10151014
voltage_uv = regulator_get_voltage(st->reg);
10161015
}
10171016

1018-
st->pdata = pdata;
1019-
10201017
if (pdata && pdata->vref_mv)
10211018
st->int_vref_mv = pdata->vref_mv;
10221019
else if (voltage_uv)
@@ -1047,7 +1044,7 @@ static int __devinit ad7192_probe(struct spi_device *spi)
10471044
if (ret)
10481045
goto error_ring_cleanup;
10491046

1050-
ret = ad7192_setup(st);
1047+
ret = ad7192_setup(st, pdata);
10511048
if (ret)
10521049
goto error_remove_trigger;
10531050

0 commit comments

Comments
 (0)