Re: [PATCH v2 14/16] iio: health: max30100: do not use internal iio_dev lock

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

 



On Tue, Oct 4, 2022 at 4:49 PM Nuno Sá <nuno.sa@xxxxxxxxxx> wrote:
>
> The pattern used in this device does not quite fit in the
> iio_device_claim_direct_mode() typical usage. In this case,
> iio_buffer_enabled() was being used not to prevent the raw access but to
> allow it. Hence, let's make use of the new
> iio_device_claim_buffer_mode() API to make sure we stay in buffered mode
> during the complete read.

...

> +               if (iio_device_claim_buffer_mode(indio_dev)) {
>                         ret = -EAGAIN;

Why is the error code shadowed? Isn't it better to return exactly the
one you resend to the upper caller(s)? Each unclear error code
shadowing should be at least explained.

> +               } else {

>                 }

-- 
With Best Regards,
Andy Shevchenko




[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