ALSA: aoa: i2sbus: use DECLARE_COMPLETION_ONSTACK() macro

Follow recommendation in Documentation/scheduler/completion.rst and
use macro to declare local 'struct completion'

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200902212133.30964-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Pierre-Louis Bossart 2020-09-02 16:21:24 -05:00 committed by Takashi Iwai
parent bec206db9d
commit 5656a7a06f

View File

@ -254,12 +254,11 @@ static void i2sbus_wait_for_stop(struct i2sbus_dev *i2sdev,
struct pcm_info *pi) struct pcm_info *pi)
{ {
unsigned long flags; unsigned long flags;
struct completion done; DECLARE_COMPLETION_ONSTACK(done);
long timeout; long timeout;
spin_lock_irqsave(&i2sdev->low_lock, flags); spin_lock_irqsave(&i2sdev->low_lock, flags);
if (pi->dbdma_ring.stopping) { if (pi->dbdma_ring.stopping) {
init_completion(&done);
pi->stop_completion = &done; pi->stop_completion = &done;
spin_unlock_irqrestore(&i2sdev->low_lock, flags); spin_unlock_irqrestore(&i2sdev->low_lock, flags);
timeout = wait_for_completion_timeout(&done, HZ); timeout = wait_for_completion_timeout(&done, HZ);