[PATCH 2/2] iio: adc: ad4695: simplify getting oversampling_ratio
From: David Lechner
Date: Tue Feb 18 2025 - 18:18:30 EST
We already have a local variable that holds a pointer to
st->channels_cfg[chan->scan_index]. Use that to simplify the code.
Signed-off-by: David Lechner <dlechner@xxxxxxxxxxxx>
---
drivers/iio/adc/ad4695.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/adc/ad4695.c b/drivers/iio/adc/ad4695.c
index 8721cbd2af34c53f0cea32e307b9ef2da46b0cfb..b38d2b3ccbfca10dfe5b05c3a96ba00f8838b89c 100644
--- a/drivers/iio/adc/ad4695.c
+++ b/drivers/iio/adc/ad4695.c
@@ -1164,7 +1164,7 @@ static int ad4695_read_raw(struct iio_dev *indio_dev,
case IIO_CHAN_INFO_OVERSAMPLING_RATIO:
switch (chan->type) {
case IIO_VOLTAGE:
- *val = st->channels_cfg[chan->scan_index].oversampling_ratio;
+ *val = cfg->oversampling_ratio;
return IIO_VAL_INT;
default:
return -EINVAL;
--
2.43.0