@@ -291,7 +291,7 @@ static int ad7280_read_channel(struct ad7280_state *st, unsigned int devaddr,
return (tmp >> 11) & 0xFFF;
}
-static int ad7280_read_all_channels(struct ad7280_state *st, unsigned int cnt,
+static int ad7280_read_all_channels(struct ad7280_state *st,
unsigned int *array)
{
int i, ret;
@@ -312,7 +312,7 @@ static int ad7280_read_all_channels(struct ad7280_state *st, unsigned int cnt,
ad7280_delay(st);
- for (i = 0; i < cnt; i++) {
+ for (i = 0; i < st->scan_cnt; i++) {
ret = __ad7280_read32(st, &tmp);
if (ret)
return ret;
@@ -687,7 +687,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
if (!channels)
return IRQ_HANDLED;
- ret = ad7280_read_all_channels(st, st->scan_cnt, channels);
+ ret = ad7280_read_all_channels(st, channels);
if (ret < 0)
goto out;
@@ -791,7 +791,7 @@ static int ad7280_read_raw(struct iio_dev *indio_dev,
case IIO_CHAN_INFO_RAW:
mutex_lock(&st->lock);
if (chan->address == AD7280A_ALL_CELLS)
- ret = ad7280_read_all_channels(st, st->scan_cnt, NULL);
+ ret = ad7280_read_all_channels(st, NULL);
else
ret = ad7280_read_channel(st, chan->address >> 8,
chan->address & 0xFF);