Re: [PATCH v2 2/2] iio: dac: Add MAX22007 DAC driver support
From: Jonathan Cameron
Date: Sun Jan 11 2026 - 10:57:08 EST
> >> + st->iio_chans[i++] = (struct iio_chan_spec) {
> >> + .output = 1,
> >> + .indexed = 1,
> >> + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
> >> + BIT(IIO_CHAN_INFO_SCALE),
> >> + .ext_info = max22007_ext_info,
> >> + .channel = reg,
> >> + .type = chan_type,
> >> + };
> > IMHO, this would look cleaner with a channel template. See ad7124, ad4130,
> > ad4170 for examples.
>
> A channel template approach was followed initially and this approach was taken up based on the latest suggestions from the reviewers, since the template is not being reused elsewhere.
FWIW I prefer this option when it is only used in one place.
Jonathan