[PATCH 03/15] iio: adc: axp288_adc: do not use internal iio_dev lock

Andy Shevchenko andy.shevchenko at gmail.com
Tue Sep 20 06:13:20 PDT 2022


On Tue, Sep 20, 2022 at 2:28 PM Nuno Sá <nuno.sa at analog.com> wrote:
>
> The iio_device lock is only meant for internal use. Hence define a
> device local lock to protect against concurrent accesses.

...

>         info = iio_priv(indio_dev);
> +       mutex_init(&info->lock);
>         info->irq = platform_get_irq(pdev, 0);
>         if (info->irq < 0)
>                 return info->irq;

Consider initializing it as late as possible, like after IRQ retrieval
in this context (maybe even deeper, but no context available). Ditto
for the rest of the series.

-- 
With Best Regards,
Andy Shevchenko



More information about the linux-amlogic mailing list