Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+3 -7
+3 -7
sound/x86/intel_hdmi_audio.c
··· 1517 1517 container_of(work, struct snd_intelhad, hdmi_audio_wq); 1518 1518 struct intel_hdmi_lpe_audio_pdata *pdata = ctx->dev->platform_data; 1519 1519 struct intel_hdmi_lpe_audio_port_pdata *ppdata = &pdata->port[ctx->port]; 1520 - int ret; 1521 1520 1522 - ret = pm_runtime_resume_and_get(ctx->dev); 1523 - if (ret < 0) 1521 + PM_RUNTIME_ACQUIRE_IF_ENABLED_AUTOSUSPEND(ctx->dev, pm); 1522 + if (PM_RUNTIME_ACQUIRE_ERR(&pm)) 1524 1523 return; 1525 1524 1526 - mutex_lock(&ctx->mutex); 1525 + guard(mutex)(&ctx->mutex); 1527 1526 if (ppdata->pipe < 0) { 1528 1527 dev_dbg(ctx->dev, "%s: Event: HAD_NOTIFY_HOT_UNPLUG : port = %d\n", 1529 1528 __func__, ctx->port); ··· 1563 1564 /* Restart the stream if necessary */ 1564 1565 had_process_mode_change(ctx); 1565 1566 } 1566 - 1567 - mutex_unlock(&ctx->mutex); 1568 - pm_runtime_put_autosuspend(ctx->dev); 1569 1567 } 1570 1568 1571 1569 /*