summaryrefslogtreecommitdiff
path: root/sound/soc/sof/ops.h
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>2026-01-12 12:09:58 +0200
committerMark Brown <broonie@kernel.org>2026-01-12 11:21:24 +0000
commit5c19da34df029fdc29fec1bedf210af7d2c4fccf (patch)
treecd2ac49beabeaba9521426052546a528066c6b9f /sound/soc/sof/ops.h
parent0cd9bf6a6d9a1861087236cc5c275b3bea83cfdd (diff)
ASoC: SOF: Use guard()/scoped_guard() for mutex locks where it makes sense
Replace the manual mutex lock/unlock pairs with guard()/scoped_guard(). Only code refactoring, and no behavior change. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://patch.msgid.link/20260112101004.7648-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/ops.h')
-rw-r--r--sound/soc/sof/ops.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/soc/sof/ops.h b/sound/soc/sof/ops.h
index d73644e85b6e..72af1f4ff620 100644
--- a/sound/soc/sof/ops.h
+++ b/sound/soc/sof/ops.h
@@ -287,16 +287,12 @@ static inline int
snd_sof_dsp_set_power_state(struct snd_sof_dev *sdev,
const struct sof_dsp_power_state *target_state)
{
- int ret = 0;
-
- mutex_lock(&sdev->power_state_access);
+ guard(mutex)(&sdev->power_state_access);
if (sof_ops(sdev)->set_power_state)
- ret = sof_ops(sdev)->set_power_state(sdev, target_state);
-
- mutex_unlock(&sdev->power_state_access);
+ return sof_ops(sdev)->set_power_state(sdev, target_state);
- return ret;
+ return 0;
}
/* debug */