static int ad7124_syscalib_locked(struct ad7124_state *st, const struct iio_chan_spec *chan)
 {
        struct device *dev = &st->sd.spi->dev;
-       struct ad7124_channel *ch = &st->channels[chan->channel];
+       struct ad7124_channel *ch = &st->channels[chan->address];
        int ret;
 
        if (ch->syscalib_mode == AD7124_SYSCALIB_ZERO_SCALE) {
                if (ret < 0)
                        return ret;
 
-               dev_dbg(dev, "offset for channel %d after zero-scale calibration: 0x%x\n",
-                       chan->channel, ch->cfg.calibration_offset);
+               dev_dbg(dev, "offset for channel %lu after zero-scale calibration: 0x%x\n",
+                       chan->address, ch->cfg.calibration_offset);
        } else {
                ch->cfg.calibration_gain = st->gain_default;
 
                if (ret < 0)
                        return ret;
 
-               dev_dbg(dev, "gain for channel %d after full-scale calibration: 0x%x\n",
-                       chan->channel, ch->cfg.calibration_gain);
+               dev_dbg(dev, "gain for channel %lu after full-scale calibration: 0x%x\n",
+                       chan->address, ch->cfg.calibration_gain);
        }
 
        return 0;
 {
        struct ad7124_state *st = iio_priv(indio_dev);
 
-       st->channels[chan->channel].syscalib_mode = mode;
+       st->channels[chan->address].syscalib_mode = mode;
 
        return 0;
 }
 {
        struct ad7124_state *st = iio_priv(indio_dev);
 
-       return st->channels[chan->channel].syscalib_mode;
+       return st->channels[chan->address].syscalib_mode;
 }
 
 static const struct iio_enum ad7124_syscalib_mode_enum = {