Re: [PATCH v14 03/11] iio: afe: rescale: add offset support

From: Andy Shevchenko
Date: Tue Feb 08 2022 - 08:43:26 EST


On Tue, Feb 8, 2022 at 4:04 AM Liam Beguin <liambeguin@xxxxxxxxx> wrote:
>
> This is a preparatory change required for the addition of temperature
> sensing front ends.

...

> + if (iio_channel_has_info(rescale->source->channel,
> + IIO_CHAN_INFO_OFFSET)) {
> + ret = iio_read_channel_offset(rescale->source,
> + &schan_off, NULL);

> + if (ret != IIO_VAL_INT)
> + return ret < 0 ? ret : -EOPNOTSUPP;

Wonder if this actually should be

if (ret < 0)
return ret;
if (ret != ...)
return -EOP...;

> + }

--
With Best Regards,
Andy Shevchenko