diff options
| author | Takashi Iwai <tiwai@suse.de> | 2025-12-16 17:11:50 +0300 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-12-23 12:51:58 +0300 |
| commit | f8c537ff0492eb27c160592702a96ea7cb19b493 (patch) | |
| tree | eafda552cfb8d7bbb430bdc2a2caec72f0c72305 | |
| parent | be9dd97060e704e702d508f4a295d06e1197ae08 (diff) | |
| download | linux-f8c537ff0492eb27c160592702a96ea7cb19b493.tar.xz | |
ALSA: x86: Clean up locks and runtime PM with guard() and co
Use PM_RUNTIME_ACQUIRE_*() and guard() for replacing the manual calls
of runtime PM and mutex lock in had_audio_wq().
Merely code cleanups and no functional changes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20251216141154.172218-6-tiwai@suse.de
| -rw-r--r-- | sound/x86/intel_hdmi_audio.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c index 8e2a007311d3..f5807fc73c54 100644 --- a/sound/x86/intel_hdmi_audio.c +++ b/sound/x86/intel_hdmi_audio.c @@ -1517,13 +1517,12 @@ static void had_audio_wq(struct work_struct *work) container_of(work, struct snd_intelhad, hdmi_audio_wq); struct intel_hdmi_lpe_audio_pdata *pdata = ctx->dev->platform_data; struct intel_hdmi_lpe_audio_port_pdata *ppdata = &pdata->port[ctx->port]; - int ret; - ret = pm_runtime_resume_and_get(ctx->dev); - if (ret < 0) + PM_RUNTIME_ACQUIRE_IF_ENABLED_AUTOSUSPEND(ctx->dev, pm); + if (PM_RUNTIME_ACQUIRE_ERR(&pm)) return; - mutex_lock(&ctx->mutex); + guard(mutex)(&ctx->mutex); if (ppdata->pipe < 0) { dev_dbg(ctx->dev, "%s: Event: HAD_NOTIFY_HOT_UNPLUG : port = %d\n", __func__, ctx->port); @@ -1564,9 +1563,6 @@ static void had_audio_wq(struct work_struct *work) /* Restart the stream if necessary */ had_process_mode_change(ctx); } - - mutex_unlock(&ctx->mutex); - pm_runtime_put_autosuspend(ctx->dev); } /* |
