summaryrefslogtreecommitdiff
path: root/sound/hda
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2022-09-19 15:10:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-18 13:41:39 +0300
commitfd0d3bf37d73de34714ccf122a0fa11abc2cfb99 (patch)
treecc111e66db7e8ed89f2246126ced906bbb408ff1 /sound/hda
parentd5952155d6d863900e32002b1f4343978f116c6e (diff)
downloadlinux-fd0d3bf37d73de34714ccf122a0fa11abc2cfb99.tar.xz
ALSA: hda: add snd_hdac_stop_streams() helper
[ Upstream commit 24ad3835a6db4f8857975effa6bf47730371a5ff ] Minor code reuse, no functionality change. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20220919121041.43463-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Stable-dep-of: 171107237246 ("ASoC: Intel: Skylake: Fix driver hang during shutdown") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/hda')
-rw-r--r--sound/hda/hdac_stream.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c
index 78d2674c7285..2beb94828729 100644
--- a/sound/hda/hdac_stream.c
+++ b/sound/hda/hdac_stream.c
@@ -143,16 +143,27 @@ void snd_hdac_stream_stop(struct hdac_stream *azx_dev)
EXPORT_SYMBOL_GPL(snd_hdac_stream_stop);
/**
+ * snd_hdac_stop_streams - stop all streams
+ * @bus: HD-audio core bus
+ */
+void snd_hdac_stop_streams(struct hdac_bus *bus)
+{
+ struct hdac_stream *stream;
+
+ list_for_each_entry(stream, &bus->stream_list, list)
+ snd_hdac_stream_stop(stream);
+}
+EXPORT_SYMBOL_GPL(snd_hdac_stop_streams);
+
+/**
* snd_hdac_stop_streams_and_chip - stop all streams and chip if running
* @bus: HD-audio core bus
*/
void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus)
{
- struct hdac_stream *stream;
if (bus->chip_init) {
- list_for_each_entry(stream, &bus->stream_list, list)
- snd_hdac_stream_stop(stream);
+ snd_hdac_stop_streams(bus);
snd_hdac_bus_stop_chip(bus);
}
}