From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB6AC3FA5CA for ; Mon, 27 Jul 2026 09:45:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785145511; cv=none; b=VHiE+zwScww5Qd3axJi5f0zI4fAAX5LVtZrAQR1p+YFw68yxexivZsrFAq1blsGgEgMz9nXfIK3KZvXBCKJHuC4mRlTaPnAIeqLUbxhgWn5KoAVF/Kaim4pJEf3din3Xw5K79jBbFFi4KAHPuuAhhdntcY3TEZm6SU8at8CdSWU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785145511; c=relaxed/simple; bh=Drn8APp5Uw6rYTgsK/ubGCbMdZovD7uDbrhOiuvrAPA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pRz5Byu7GGN/AB8mY5KjAWSMbN67PEPmg2QYKi4BLWVtqbT2q7cRdiUAtoAGM42tPziToK/h4D1jNSGU1ym9DfCPDBL7ar8oLw5IMP6KApKedJHa3yc3ofbIabz4KoKKkv15LNAsyHNLup0deDdPieTYYb48e0dOMy+Fa6n+20A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hcVEGCUx; arc=none smtp.client-ip=209.85.215.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hcVEGCUx" Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-c9e0b89e228so1662571a12.1 for ; Mon, 27 Jul 2026 02:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785145508; x=1785750308; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=OeWw6h5jytB2MGM9QIlVlvrzPpa8kERJj1qhZ9lmXsU=; b=hcVEGCUxQwI28nbi1G3ouB3HtPI8NEacC4Tv3743+bfNFtQK8VL2+fnak6bMH3mE/N solnYVPVvZWhc/bwUgEqJGrZqsrNpxElih/+JImvVvjHYfu4C3Hbc2sPoh4kHEb60MOZ mtImNql9U/SExkYWtijAamd+R0qixAubfCJyOJmY876tzf2Tmw030EgtK85stWQ1Asqg QPC8yrG0LY4ZiA+XnOcVz1zb8+0MTTrOG6F1g0dtKjwZbU9hQmHhYgQcIAZegnD/eNtl 3thoGQmS0qnuyh1cTXxQmi1WAP4qjzddkhgKQlfykKfip2zs7UvY0TmCbqSUxKhij4Np +YLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785145508; x=1785750308; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=OeWw6h5jytB2MGM9QIlVlvrzPpa8kERJj1qhZ9lmXsU=; b=RTbRQZvGcUeiRNJo+bteXqGRLgBREbVzkGdKwXo4fYNsxyvE1MbFVwKcjLC0Lwzmyo kEkNr3vajUMlbIMIOkvqFGxrajdCoy30UB+8TU1QpwBXJvSSJvmzvAZF3ZgkNUsuzdxF YKsjhMV43zaAb3SiMjMtrFIKAOXqhJhGQhq9igROIWI/eJDRh1sK0q0u9KLQIh0oo+Of FZfh8sFvvHwkBaeiz8rdRlMy3Vl+x/gSphaIz5NtEAZhz2W5xz4oF3cQ7cDeVXNct8Zl D1UCS7y+f4e0Qp4sC6QzAGF7n8NbGAeTYmDFimXfHHODFgYGnDNEXV7AhIZsFGo9ZCDs EIvQ== X-Forwarded-Encrypted: i=1; AHgh+RrW1UTt05r3XILj1Tqcfpfussfav5ZAEcFJ1CYGKrxjHE60PriLe5tGECbwcECjHExC3hi7rzt9R51itPA=@vger.kernel.org X-Gm-Message-State: AOJu0YyQSOXMNiK2H3BVjCM11EkeQYGSVPZnNoA5Id2L8AGz7uSyTPWh 9KrnGB+vAGMZIAP+luz+ZTc2IbInLh+4U9sCjOGw3qTEF4RZlgAY38mV X-Gm-Gg: AR+sD12k+H9+4Y/uM1yzh+uqTUTPZS07Fv2TpShTORdBRfHnwMKebqYf2eXT+COTuuE ioncu4zMnuhNBGTKpXhgQX/3tA0sjsed01pe9cDk5YCdTDEl6EGKbUIt3a4OaMZDdZWNJ2e8G8P HQYxQPLh3JAzH+SEY4sThnn73hnLsSv3A90rylu2yRRZW2K8d2TJyojRAJuiApOSBuGHfut10os 2HT31GrW3h24O54J1WLfue+ej3N3NAj0JfOq/hKERTp3n2S8u8Z/r6oYNTKXc5COuYesnl3o5Nm ZzGdIN+j7sCnznkLE7hQLcuMMxlTqIYio+5GacifI1rt408ncDIXW/eVfGEvEHDTIo2gZLv75ui rdxZM7DfT5K3LqORvgfWLdGiRB6aQMc1Qx5USpx7HHrNnaBxcG1BqCBstVk3I0pCpirx5nMZLmP rjFIel+GXc4qcoFKvY8hj/PhCl78lKVwHqmjVRN+9H3499KBMCs8GOlnTuVim0XlSJpkB8Nxqid qNHURdYSX2q2FXquu1GEw== X-Received: by 2002:a05:6a21:b89:b0:3c3:6544:6083 with SMTP id adf61e73a8af0-3c67d55e260mr7269403637.0.1785145508419; Mon, 27 Jul 2026 02:45:08 -0700 (PDT) Received: from phuc-desktop.. ([183.91.15.56]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cbbb66b5ffesm2959018a12.19.2026.07.27.02.45.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2026 02:45:08 -0700 (PDT) From: phucduc.bui@gmail.com To: Mark Brown , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Lars-Peter Clausen , nuno.sa@analog.com, Shenghao Ding , Kevin Lu Cc: Baojun Xu , Sen Wang , Steven Eckhoff , Srinivas Kandagatla , Kuninori Morimoto , Charles Keepax , Linus Walleij , u.kleine-koenig@baylibre.com, Thorsten Blum , Kees Cook , Chen Ni , Bartosz Golaszewski , Shengjiu Wang , Sebastian Krzyszkowiak , Pengpeng Hou , Richard Fitzgerald , patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org, bui duc phuc Subject: [PATCH v2 24/26] ASoC: codecs: wm971x: Use guard() for mutex locks Date: Mon, 27 Jul 2026 16:40:44 +0700 Message-ID: <20260727094046.23001-25-phucduc.bui@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260727094046.23001-1-phucduc.bui@gmail.com> References: <20260727094046.23001-1-phucduc.bui@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: bui duc phuc Clean up the code using guard() for mutex locks. Merely code refactoring, and no behavior change. Signed-off-by: bui duc phuc --- sound/soc/codecs/wm9712.c | 5 ++--- sound/soc/codecs/wm9713.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c index 83cd42fa0c28..3105b2e0556f 100644 --- a/sound/soc/codecs/wm9712.c +++ b/sound/soc/codecs/wm9712.c @@ -6,6 +6,7 @@ * Author: Liam Girdwood */ +#include #include #include #include @@ -229,7 +230,7 @@ static int wm9712_hp_mixer_put(struct snd_kcontrol *kcontrol, shift = mc->shift & 0xff; mask = 1 << shift; - mutex_lock(&wm9712->lock); + guard(mutex)(&wm9712->lock); old = wm9712->hp_mixer[mixer]; if (ucontrol->value.integer.value[0]) wm9712->hp_mixer[mixer] |= mask; @@ -251,8 +252,6 @@ static int wm9712_hp_mixer_put(struct snd_kcontrol *kcontrol, &update); } - mutex_unlock(&wm9712->lock); - return change; } diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index b3bbecf074ee..3ba7ca3c1770 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c @@ -11,6 +11,7 @@ * o Support for DAPM */ +#include #include #include #include @@ -238,7 +239,7 @@ static int wm9713_hp_mixer_put(struct snd_kcontrol *kcontrol, shift = mc->shift & 0xff; mask = (1 << shift); - mutex_lock(&wm9713->lock); + guard(mutex)(&wm9713->lock); old = wm9713->hp_mixer[mixer]; if (ucontrol->value.integer.value[0]) wm9713->hp_mixer[mixer] |= mask; @@ -260,8 +261,6 @@ static int wm9713_hp_mixer_put(struct snd_kcontrol *kcontrol, &update); } - mutex_unlock(&wm9713->lock); - return change; } -- 2.43.0