struct device *dev = &st->spi->dev;
struct iio_chan_spec *ad4851_channels;
const struct iio_chan_spec ad4851_chan = AD4858_IIO_CHANNEL;
- int ret;
+ int ret, i = 0;
ret = ad4851_parse_channels_common(indio_dev, &ad4851_channels,
ad4851_chan);
return ret;
device_for_each_child_node_scoped(dev, child) {
- ad4851_channels->has_ext_scan_type = 1;
+ ad4851_channels[i].has_ext_scan_type = 1;
if (fwnode_property_read_bool(child, "bipolar")) {
- ad4851_channels->ext_scan_type = ad4851_scan_type_20_b;
- ad4851_channels->num_ext_scan_type = ARRAY_SIZE(ad4851_scan_type_20_b);
+ ad4851_channels[i].ext_scan_type = ad4851_scan_type_20_b;
+ ad4851_channels[i].num_ext_scan_type = ARRAY_SIZE(ad4851_scan_type_20_b);
} else {
- ad4851_channels->ext_scan_type = ad4851_scan_type_20_u;
- ad4851_channels->num_ext_scan_type = ARRAY_SIZE(ad4851_scan_type_20_u);
+ ad4851_channels[i].ext_scan_type = ad4851_scan_type_20_u;
+ ad4851_channels[i].num_ext_scan_type = ARRAY_SIZE(ad4851_scan_type_20_u);
}
- ad4851_channels++;
+ i++;
}
indio_dev->channels = ad4851_channels;