Re: [PATCH v2 3/3] iio: adc: update ad7779 to use IIO backend

From: Jonathan Cameron
Date: Sat Aug 09 2025 - 15:38:08 EST



>
> > +static int ad7779_conf_channels(struct iio_dev *indio_dev, const struct ad7779_state *st)
> > +{
> > + struct iio_chan_spec *channels;
> > + struct device *dev = &st->spi->dev;
> > + int num_channels = ARRAY_SIZE(ad7779_channels);
> > +
> > + channels = devm_kcalloc(dev, num_channels, sizeof(*channels), GFP_KERNEL);
>
> Doesn't sound like a right place for devm. Is this function called only at probe stage?
Yup. So probably wants a name that doesn't sound like a runtime thing. setup_channels maybe?

>