summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-09-30 10:05:32 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-10-03 16:07:02 -0700
commit5357ba3df4af9da111fb351292c9a410b1f7ab0a (patch)
tree5173796cfea0b39024815ed373f5478e97059985
parent7c626f58ab0095d7614636cc81f6081426903a37 (diff)
staging:iio:adc:ad799x trivial: use the convenient chan struct.
This is much cleaner than bouncing through the various structures to get to the same thing. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/iio/adc/ad799x_core.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c
index 975a3f7122cf..8a7dce05477c 100644
--- a/drivers/staging/iio/adc/ad799x_core.c
+++ b/drivers/staging/iio/adc/ad799x_core.c
@@ -158,12 +158,11 @@ static int ad799x_read_raw(struct iio_dev *dev_info,
if (ret < 0)
return ret;
- *val = (ret >> st->chip_info->channel[0].scan_type.shift) &
- RES_MASK(st->chip_info->channel[0].scan_type.realbits);
+ *val = (ret >> chan->scan_type.shift) &
+ RES_MASK(chan->scan_type.realbits);
return IIO_VAL_INT;
case (1 << IIO_CHAN_INFO_SCALE_SHARED):
- scale_uv = (st->int_vref_mv * 1000)
- >> st->chip_info->channel[0].scan_type.realbits;
+ scale_uv = (st->int_vref_mv * 1000) >> chan->scan_type.realbits;
*val = scale_uv / 1000;
*val2 = (scale_uv % 1000) * 1000;
return IIO_VAL_INT_PLUS_MICRO;