diff options
| author | Peter Ujfalusi <peter.ujfalusi@linux.intel.com> | 2026-01-12 12:09:59 +0200 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-01-12 11:21:24 +0000 |
| commit | 599a5b00a1bf2fdc5abb42985eb21c1ce3489416 (patch) | |
| tree | 28dad69e52ee0de22def4da668cdd025d04035a0 /sound/soc/sof/intel/hda-mlink.c | |
| parent | 5c19da34df029fdc29fec1bedf210af7d2c4fccf (diff) | |
| download | linux-next-599a5b00a1bf2fdc5abb42985eb21c1ce3489416.tar.gz linux-next-599a5b00a1bf2fdc5abb42985eb21c1ce3489416.zip | |
ASoC: SOF: Intel: 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-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/intel/hda-mlink.c')
| -rw-r--r-- | sound/soc/sof/intel/hda-mlink.c | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/sound/soc/sof/intel/hda-mlink.c b/sound/soc/sof/intel/hda-mlink.c index ce561fe52bd5..6f15213937a3 100644 --- a/sound/soc/sof/intel/hda-mlink.c +++ b/sound/soc/sof/intel/hda-mlink.c @@ -524,11 +524,8 @@ void hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, boo hlink = &h2link->hext_link; - mutex_lock(&h2link->eml_lock); - - hdaml_link_enable_interrupt(hlink->ml_addr + AZX_REG_ML_LCTL, enable); - - mutex_unlock(&h2link->eml_lock); + scoped_guard(mutex, &h2link->eml_lock) + hdaml_link_enable_interrupt(hlink->ml_addr + AZX_REG_ML_LCTL, enable); } EXPORT_SYMBOL_NS(hdac_bus_eml_enable_interrupt, "SND_SOC_SOF_HDA_MLINK"); @@ -837,11 +834,8 @@ int hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num) hlink = &h2link->hext_link; - mutex_lock(&h2link->eml_lock); - - hdaml_link_set_lsdiid(hlink->ml_addr + AZX_REG_ML_LSDIID_OFFSET(sublink), dev_num); - - mutex_unlock(&h2link->eml_lock); + scoped_guard(mutex, &h2link->eml_lock) + hdaml_link_set_lsdiid(hlink->ml_addr + AZX_REG_ML_LSDIID_OFFSET(sublink), dev_num); return 0; } EXPORT_SYMBOL_NS(hdac_bus_eml_sdw_set_lsdiid, "SND_SOC_SOF_HDA_MLINK"); @@ -875,12 +869,8 @@ int hdac_bus_eml_sdw_map_stream_ch(struct hdac_bus *bus, int sublink, int y, lchan = 0; } - mutex_lock(&h2link->eml_lock); - - hdaml_shim_map_stream_ch(pcmsycm, lchan, hchan, - stream_id, dir); - - mutex_unlock(&h2link->eml_lock); + scoped_guard(mutex, &h2link->eml_lock) + hdaml_shim_map_stream_ch(pcmsycm, lchan, hchan, stream_id, dir); val = readw(pcmsycm); @@ -1012,11 +1002,8 @@ int hdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool e hlink = &h2link->hext_link; - mutex_lock(&h2link->eml_lock); - - hdaml_lctl_offload_enable(hlink->ml_addr + AZX_REG_ML_LCTL, enable); - - mutex_unlock(&h2link->eml_lock); + scoped_guard(mutex, &h2link->eml_lock) + hdaml_lctl_offload_enable(hlink->ml_addr + AZX_REG_ML_LCTL, enable); return 0; } |
