On Fri, Feb 9, 2024 at 5:26 PM Nuno Sa <nuno.sa@xxxxxxxxxx> wrote: > > Convert the driver to use the new IIO backend framework. The device > functionality is expected to be the same (meaning no added or removed > features). > > Also note this patch effectively breaks ABI and that's needed so we can > properly support this device and add needed features making use of the > new IIO framework. > > Given the lack of features (and devices supported) in the ad9467 driver > compared with the ADI out of tree version, we don't expect any user of > the upstream driver so no one should notice the ABI breakage. However, > if someone is affected by this, ADI will happily support transitioning > to the backend framework. ... > struct ad9467_chip_info { > - struct adi_axi_adc_chip_info axi_adc_info; > - unsigned int default_output_mode; > - unsigned int vref_mask; > + const char *name; > + unsigned int id; > + const struct iio_chan_spec *channels; > + unsigned int num_channels; > + const unsigned int (*scale_table)[2]; > + int num_scales; > + unsigned long max_rate; > + unsigned int default_output_mode; > + unsigned int vref_mask; > }; Seems like you haven't checked this layout with `pahole`. ... > +static int ad9467_iio_backend_get(struct ad9467_state *st) > +{ > + struct device *dev = &st->spi->dev; > + struct device_node *__back; > + > + st->back = devm_iio_backend_get(&st->spi->dev, NULL); Simply 'dev' as the first parameter? ... > + /* If not found, don't error out as we might have legacy DT property */ This seems related to ENOENT, correct? > + if (!IS_ERR(st->back)) > + return 0; And the above is about something else (found?) case, right? > + if (PTR_ERR(st->back) != -ENOENT) > + return PTR_ERR(st->back); -- With Best Regards, Andy Shevchenko