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); } /*