ALSA: hda - Move prepared flag into struct hdac_stream
This flag seems used commonly, so deserves to be located there.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
index 15bc039..dbeb195 100644
--- a/include/sound/hdaudio.h
+++ b/include/sound/hdaudio.h
@@ -390,6 +390,7 @@
bool opened:1;
bool running:1;
+ bool prepared:1;
bool no_period_wakeup:1;
bool locked:1;
diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c
index 9bc8eaf..14ffb6b 100644
--- a/sound/pci/hda/hda_controller.c
+++ b/sound/pci/hda/hda_controller.c
@@ -145,7 +145,7 @@
snd_hda_codec_cleanup(apcm->codec, hinfo, substream);
err = chip->ops->substream_free_pages(chip, substream);
- azx_dev->prepared = 0;
+ azx_stream(azx_dev)->prepared = 0;
dsp_unlock(azx_dev);
return err;
}
@@ -214,7 +214,7 @@
unlock:
if (!err)
- azx_dev->prepared = 1;
+ azx_stream(azx_dev)->prepared = 1;
dsp_unlock(azx_dev);
return err;
}
@@ -240,7 +240,7 @@
else
sync_reg = AZX_REG_SSYNC;
- if (dsp_is_locked(azx_dev) || !azx_dev->prepared)
+ if (dsp_is_locked(azx_dev) || !hstr->prepared)
return -EPIPE;
switch (cmd) {
@@ -843,7 +843,7 @@
return err;
}
- azx_dev->prepared = 0;
+ hstr->prepared = 0;
return err;
}
EXPORT_SYMBOL_GPL(snd_hda_codec_load_dsp_prepare);
diff --git a/sound/pci/hda/hda_controller.h b/sound/pci/hda/hda_controller.h
index 407cba6..173bf7c 100644
--- a/sound/pci/hda/hda_controller.h
+++ b/sound/pci/hda/hda_controller.h
@@ -62,7 +62,6 @@
struct hdac_stream core;
unsigned int irq_pending:1;
- unsigned int prepared:1;
/*
* For VIA:
* A flag to ensure DMA position is 0