From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 19FCF384CCD; Thu, 17 Sep 2026 15:31:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789659091; cv=none; b=CNoV936s4IarUxy1ICY3E0iFFUuB5I9TI6QLI1q50wzma99eYSDZ6KL8KuWCaXsVV03axs+He4O0vh0hwfpEhej4TDBqeVwjruQKLGjFJdFRpTFFD0jffdxAEg3vyn596z46DHaJR4DgIYza+VCxrdFvMDj9yVWYcmcwjxLdIF8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789659091; c=relaxed/simple; bh=Idasqce+6daeHqTGs6rISuoQW97yDTesVSdasQTvyiI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IcWO0d5UhHQm6EULBEZd03WPd5wxwyGio8BexqVSdT/slh34JQV9SkVfQp5BOWFflbxW7HhRqy+wHIzHXkRnLZmTTsJPFppFpjDteXVG4ebkWiZ48iLbIxzTe4spriGDhScaw2pARxYyTW2pQa3KtfpKI8kZLkd1aE1TpZF86FU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YBv+hXx4; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YBv+hXx4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFCBE1F00899; Thu, 17 Sep 2026 15:31:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789659084; bh=9p0lV56rzyT17GC2tbmNrQH1Lm5P6x4Vm7hsc/nhk2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YBv+hXx4srHiG/OBuw3yYRb7vNBYDkaZlIqqu3zLXs79HGMtbPHRV+6HMgm891oFv cHAlaTSABEOn0JUZ3sLq+FkGzq0K7Q3EMFlBxqXSYBNuasW+F+/8JIsRZjD0cbTAD3 QdCn4xiYPZmvA9WUNWpIlE0eUBboETSoyz7UBMRA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Cezary Rojewski , bui duc phuc , Mark Brown , Sasha Levin Subject: [PATCH 7.2 121/733] ASoC: codecs: ab8500: Use guard() for mutex locks Date: Thu, 17 Sep 2026 16:07:09 +0100 Message-ID: <20260917151354.020175727@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151350.597953846@linuxfoundation.org> References: <20260917151350.597953846@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: bui duc phuc [ Upstream commit 350b7eae8e8b2bd3885a3e2424381494d6bde038 ] Clean up the code using guard() for mutex locks. Merely code refactoring, and no behavior change. Reviewed-by: Cezary Rojewski Signed-off-by: bui duc phuc Link: https://patch.msgid.link/20260708125002.202515-2-phucduc.bui@gmail.com Signed-off-by: Mark Brown Stable-dep-of: ec75e653b70c ("ASoC: ab8500: Remove the nonfunctional sidetone apply control") Signed-off-by: Sasha Levin --- sound/soc/codecs/ab8500-codec.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sound/soc/codecs/ab8500-codec.c b/sound/soc/codecs/ab8500-codec.c index 63b0d57341396..167f021c7ecbc 100644 --- a/sound/soc/codecs/ab8500-codec.c +++ b/sound/soc/codecs/ab8500-codec.c @@ -14,6 +14,7 @@ * for ST-Ericsson. */ +#include #include #include #include @@ -981,9 +982,8 @@ static int sid_status_control_get(struct snd_kcontrol *kcontrol, struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(component->dev); - mutex_lock(&drvdata->ctrl_lock); + guard(mutex)(&drvdata->ctrl_lock); ucontrol->value.enumerated.item[0] = drvdata->sid_status; - mutex_unlock(&drvdata->ctrl_lock); return 0; } @@ -1006,7 +1006,7 @@ static int sid_status_control_put(struct snd_kcontrol *kcontrol, return -EIO; } - mutex_lock(&drvdata->ctrl_lock); + guard(mutex)(&drvdata->ctrl_lock); sidconf = snd_soc_component_read(component, AB8500_SIDFIRCONF); if (((sidconf & BIT(AB8500_SIDFIRCONF_FIRSIDBUSY)) != 0)) { @@ -1017,7 +1017,8 @@ static int sid_status_control_put(struct snd_kcontrol *kcontrol, } else { status = -EBUSY; } - goto out; + dev_dbg(component->dev, "%s: Exit\n", __func__); + return status; } snd_soc_component_write(component, AB8500_SIDFIRADR, 0); @@ -1035,9 +1036,6 @@ static int sid_status_control_put(struct snd_kcontrol *kcontrol, drvdata->sid_status = SID_FIR_CONFIGURED; -out: - mutex_unlock(&drvdata->ctrl_lock); - dev_dbg(component->dev, "%s: Exit\n", __func__); return status; -- 2.53.0