Re: [PATCH v2 06/11] iio: adc: ad7793: use spi_get_device_match_data()

From: Andy Shevchenko

Date: Fri Dec 04 2026 - 07:01:45 EST


On Fri, Dec 04, 2026 at 11:44:22AM +0000, Nuno Sá wrote:
> On Thu, Dec 03, 2026 at 06:37:34PM +0200, Andy Shevchenko wrote:
> > On Wed, Dec 02, 2026 at 05:05:38PM +0000, Nuno Sá wrote:

...

> > > - st->chip_info =
> > > - &ad7793_chip_info_tbl[spi_get_device_id(spi)->driver_data];
> > > + st->chip_info = spi_get_device_match_data(spi);
> > > + if (!st->chip_info)
> > > + return -ENODEV;
> >
> > -ENODATA
>
> Oh, is this now the agreed code for the above?

Yep. The rationale is that ENODEV and EINVAL are way too much overloaded
semantically. While ENODATA is also used in several cases by several APIs
it is still better fit.

--
With Best Regards,
Andy Shevchenko