Re: [PATCH v10 6/7] iio: adc: ad9467: convert to backend framework

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2024-02-09 at 18:37 +0200, Andy Shevchenko wrote:
> 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`.
> 

Not really... IIRC, I just copied the members as-is from the previous struct. Can be
done later I guess...

> ...
> 
> > +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?
> 

Makes sense...

> ...
> 
> > +       /* If not found, don't error out as we might have legacy DT property */
> 
> This seems related to ENOENT, correct?

Yeah, the comments are in line with the original version of the code where I was
first checking for errors.

- Nuno Sá





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux