From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.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 1186A34888F for ; Fri, 31 Jul 2026 03:13:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785467607; cv=none; b=h/DbPYnQBRMFWgtWxnBntkef9jgyKoz0ZEerrzCIUsGt6dnsvsuL4Hx7fRCWR8OuW39OPidxcdfoCkRFNOKnYgDJ0l5JY7Zf808pAvoBABqCzH2nmHSNAeEkflex5hTHW7igz6guCeKT32YjuxjX8vfUQ17nLIYT75IDCUSQAtM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785467607; c=relaxed/simple; bh=zbnnO5QqCp0aKW1u4NgpP6pgs62g6NaFKUTTPYSlujg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rwz6IQ3P1oITjYGIRqsQw6nBI7brRmm7DdDT6jF/TY6OetvMmSEJrKJ9qb/41c+tOx7H+4mrVTFYns/YdlY49yELgEbNkYBJG08vS4pnODutCsS5v/0RE/x26fIXGHpNFPN/1/GiQZf48UUw5SGT5sHReV6W6UMnOt832z4L6Nc= 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=lNriZ2+l; arc=none smtp.client-ip=209.85.214.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="lNriZ2+l" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2caea3f742bso5697075ad.0 for ; Thu, 30 Jul 2026 20:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785467605; x=1786072405; 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=QWKh2+oHygCqr6F5Ht9/yhyfhRUrXXYvySUt8Ac5ouA=; b=lNriZ2+l9/f3vFRCskbmVqkw0OzNAWE42BCJtJUkUEazseOQjkVHU3a8SJQZgJpCAe SYCfLEX8AbRpJQ6kjYzFaI5XEB8LcpB6HOAT5Z33dqruzMmE6nWSAq7o/SJfEPq9SAfd aWcvNHVBDVdDg7hM3IcUnK1/41Q19OER8xokEurEBTeI8DN4IK4dzulagFOR9d296zZl OEQrNMVkFnJmEkggg0nyieEWr9kVQIOQBEtjGYhGn6qnnh6hsXuVeuPIZJqdgTnSsf99 5X20VmvJZY8eKVS5GHFFDeuMa5rRtsTFH5G8a1ddjTaQFYYyjXSU/V1Tb66xGw6W7lxa 4AXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785467605; x=1786072405; 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=QWKh2+oHygCqr6F5Ht9/yhyfhRUrXXYvySUt8Ac5ouA=; b=GWKqG3sKG3mMbkQcBiVLi4xIppTUoTmw8dsWzauqnSZoahZkHBB2p40ydvcwQBKvav qvtF8vSswxhl+exa/zcU2+7UsaQO0LoStQy4aUxPlCKUoK1GtdZtE9Zi3466f7rDaUA2 GgJ8sS4NUP918ZdFRMi5J5dsye7Ee99bmLg7hDBrR5eDwEMD7cjM6bNb7VqaJfybCfnY mKXcNtGdqpRYUA6C+PcD3cB1E1lLYS9Astlnl4QLKNHbPnj45jl6s/I9F9o6r8Rn7yYJ eh2OE6Xt2GGiaVIC5i3pgsb33RteRjC2sRVuzHQQb6GReoOklbaD5jMKycekwQOreglS WCUw== X-Forwarded-Encrypted: i=1; AHgh+RrO+4J7mKjnqhofHGwU6TBgNweC0ncWqKxQxAFU34WdJzdAYV0L/Fts1hFeNMVtaiTEjHJx4tF2+DDLZkM=@vger.kernel.org X-Gm-Message-State: AOJu0YxEcZIGcrbV1+hE+L0OkjWs/bsNvPoy3vanzQfhVWTXU73ADwZ+ exhW5rCVcM3miU3Xd396FvWXDsuSLTGgEEWWiG8Tsi5aIfts+lKz0OSv X-Gm-Gg: AR+sD13YAO6qVHGQBEv7ArFJZP5mHa8DdhY+BWwSDglTHfGUwwrK+zlV1jqMg1xRwQ9 HAE5YQfCjOwjgSBxqKbZNCYXIUanrU75XvS9Q0v04KcLjTC8YbFFi6yZ4IMq8+HFqeqdurJHQw9 0t9GGNSZZXOLEcF4wSZSbomxaaL5oOBllG9El1tjpLATZEw68wOHgrzS1byBRMWz/3fwNfMjqb6 1JB/+86o5sKAI9vdmHUZ/ZNZNCAiwpEExevnNVPv0XsVB3d18nSHytq6cQVjdNp3Wl1T8vRi7kI IBB7NQqWGSTGHRA2jdIgoSgKbt1/lrZS/GKGrO/nrDJ3CjwR0F0avTBDWdQmllJWANyEW0iMpSq uC0+u4prmmyQQ9uIc3WIsmBUqMkL7wtPT5pEd+mzqwAES/mvnrYZKEkKTXeWtuB75H4L+uRzPeV xFK0yvkbtTH1bAt/LjhCV6COkMyXBgCIsRbdRXDyowuiFuq42bn2DmYABlJaFkODMtinlSMnA1p gqjxd6oaOSV/slpd3MDUc7kyGFRN4QnC1dt5ug7IA9pmcxo9ZvSYlqAWvG7lIJOkT6ovkvsB86h uGrq X-Received: by 2002:a17:903:2443:b0:2cc:f5b8:4c2e with SMTP id d9443c01a7336-2d046d5331cmr5207485ad.9.1785467605379; Thu, 30 Jul 2026 20:13:25 -0700 (PDT) Received: from phuc-desktop.. ([183.91.15.56]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d047ae9f31sm737595ad.60.2026.07.30.20.13.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 20:13:24 -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 , Cezary Rojewski , Richard Fitzgerald 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 , 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 v3 24/26] ASoC: codecs: wm971x: Use guard() for mutex locks Date: Fri, 31 Jul 2026 10:06:46 +0700 Message-ID: <20260731030648.8706-25-phucduc.bui@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260731030648.8706-1-phucduc.bui@gmail.com> References: <20260731030648.8706-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. Reviewed-by: Richard Fitzgerald Signed-off-by: bui duc phuc --- Changes in v3: - Add Reviewed-by tag from Richard Fitzgerald. 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