Re: [PATCH v3 03/14] iio: adc: adi-axi-adc: Initialize state mutex

Jonathan Cameron <[email protected]>
Newsgroups org.kernel.vger.linux-gpio,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-doc,org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Message-ID <20260816192953.38376b22@jic23-huawei>
On Thu, 13 Aug 2026 15:56:56 +0200
Janani Sunil <[email protected]> wrote:

> The AXI ADC register access paths serialize transactions with st->lock,
> but probe does not initialize it. Initialize the mutex before registering
> the backend.
> 
> Fixes: 7ecb8ee5c93b ("iio: adc: adi-axi-adc: support digital interface calibration")
> Signed-off-by: Janani Sunil <[email protected]>
Fixes come first.  In future move this up to start of series so it is
really obvious.

Given it's kind of critical, I'll apply it to the fixes-togreg branch now.

Note that branch won't go upstream until after rc1, but I think it won't
be too disruptive to have this series go through the slow togreg tree
in parallel with that.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/adi-axi-adc.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c
> index 26b9c75bd4d8..b5e59b1871b6 100644
> --- a/drivers/iio/adc/adi-axi-adc.c
> +++ b/drivers/iio/adc/adi-axi-adc.c
> @@ -684,6 +684,10 @@ static int adi_axi_adc_probe(struct platform_device *pdev)
>  	if (!st)
>  		return -ENOMEM;
>  
> +	ret = devm_mutex_init(dev, &st->lock);
> +	if (ret)
> +		return ret;
> +
>  	base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(base))
>  		return PTR_ERR(base);
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.