From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BCCA2F7AA1; Sat, 20 Sep 2025 11:06:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758366396; cv=none; b=g3jZxjcMJIKA0N++bljbWAS938lV2FzitM+ZUbqwh/hQp6saoWurH/77judtKv9Scp7sNzbTXhT9N0y89OwfdAot1LPQalZCEXCDStQBKDElmHLAzho4YLuexv0fMA5MWNrKz4TdC1jyADpKbgFlQqURsYsOtmZtXDwDfaUXo74= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758366396; c=relaxed/simple; bh=IHYF4fNI1oCnSq4pPg7KO014w0tMqzNW/+gAbGAx5jk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZdwMzb3qiVW8mxBEy2J/rkkQijOL8iSoZMM6tJ79OHB42r3ebhL9K6v8zVAcFi5QGY9IjKNdol3PZQfAd9JxrfRtRhiVXwnOs0C95uHG/Wd/FTLA1kTfgRoDqYoQvg73ljhZwM7S88AETiKU7yI78y/w4hdPK1j5FP3sVuVpyHM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O7r0zvnN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O7r0zvnN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91D39C4CEEB; Sat, 20 Sep 2025 11:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758366396; bh=IHYF4fNI1oCnSq4pPg7KO014w0tMqzNW/+gAbGAx5jk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=O7r0zvnNZb1vwinp3SBO7mS8ko9Xhkr/Q4HQdSXsiYrurJ6vjAdRPsBfyFShyydcW chq/uZa9UbI+CD+8l1aBUsGcmXeuG5bmyEIHFiJuSKZ8sHtjM6SPQMQcQbrZLkXtHf PGyXG/9sflpJhBywjKsiNvLll+mRXuMaqK01j0OD7tmARCDr0IIvRpYQRS4zeND9dx hxISftz9NSQLIn2u0dhP/sqX33vflFJ+Hph5P8n7eOdK2ucnCklS3abJhqnxqDDwgW K0bPl3VUSmJh+mdqXGFiQdahCA9rZT+uNy+qNKyFXNf7z6ZKbmRig68N+lKcQ4m85E +ts/FeQnA4S/Q== Date: Sat, 20 Sep 2025 12:06:27 +0100 From: Jonathan Cameron To: David Lechner Cc: Michael Hennerich , Nuno =?UTF-8?B?U8Oh?= , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: adc: ad7124: use devm_mutex_init() Message-ID: <20250920120627.307a8bdd@jic23-huawei> In-Reply-To: <20250917-iio-adc-ad7124-use-devm_mutex_init-v1-1-ff23fe3ad954@baylibre.com> References: <20250917-iio-adc-ad7124-use-devm_mutex_init-v1-1-ff23fe3ad954@baylibre.com> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.50; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 17 Sep 2025 10:22:30 -0500 David Lechner wrote: > Use devm_mutex_init() to initialize the mutex to handle automatically > freeing in debug builds. > > Signed-off-by: David Lechner Normally I'd say this isn't worth the churn but fine this time given all the other patches for this driver. Applied to iio.git/testing Jonathan > --- > drivers/iio/adc/ad7124.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/ad7124.c b/drivers/iio/adc/ad7124.c > index 9ace3e0914f5acab695c0382df758f56f333ae72..9d9250274b9a02e2982e6ceda27009a84413dc2f 100644 > --- a/drivers/iio/adc/ad7124.c > +++ b/drivers/iio/adc/ad7124.c > @@ -1482,7 +1482,10 @@ static int ad7124_setup(struct ad7124_state *st) > st->adc_control &= ~AD7124_ADC_CONTROL_MODE; > st->adc_control |= FIELD_PREP(AD7124_ADC_CONTROL_MODE, AD_SD_MODE_IDLE); > > - mutex_init(&st->cfgs_lock); > + ret = devm_mutex_init(dev, &st->cfgs_lock); > + if (ret) > + return ret; > + > INIT_KFIFO(st->live_cfgs_fifo); > for (i = 0; i < st->num_channels; i++) { > struct ad7124_channel_config *cfg = &st->channels[i].cfg; > > --- > base-commit: 561285d048053fec8a3d6d1e3ddc60df11c393a0 > change-id: 20250917-iio-adc-ad7124-use-devm_mutex_init-45a297b1ff8f > > Best regards,