]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ALSA: hda: add snd_hdac_stop_streams() helper
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 19 Sep 2022 12:10:38 +0000 (14:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:39 +0000 (11:41 +0100)
[ Upstream commit 600caedbee3655212eab8bb8d368244e5485d6b2 ]

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: 82b338c10a55 ("ASoC: Intel: Skylake: Fix driver hang during shutdown")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/sound/hdaudio.h
sound/hda/hdac_stream.c
sound/pci/hda/hda_controller.c

index 53e081bcd8ec9a4dfa0f270476d7cef75d6414bd..749b1bce9fc627d689fb69a5468f1125adbff175 100644 (file)
@@ -555,6 +555,7 @@ int snd_hdac_stream_set_params(struct hdac_stream *azx_dev,
 void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start);
 void snd_hdac_stream_clear(struct hdac_stream *azx_dev);
 void snd_hdac_stream_stop(struct hdac_stream *azx_dev);
+void snd_hdac_stop_streams(struct hdac_bus *bus);
 void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus);
 void snd_hdac_stream_reset(struct hdac_stream *azx_dev);
 void snd_hdac_stream_sync_trigger(struct hdac_stream *azx_dev, bool set,
index 78d2674c7285bf04e1e145087e006b5e4f488ed6..2beb94828729d6319dca23e966c805740828aac2 100644 (file)
@@ -142,17 +142,28 @@ 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);
        }
 }
index 6a159c6c2f54688d0c9256a0f230b5197ff5b26e..6dff68691dffff656e421f814fe8ca44e2692977 100644 (file)
@@ -1093,10 +1093,8 @@ EXPORT_SYMBOL_GPL(azx_init_chip);
 void azx_stop_all_streams(struct azx *chip)
 {
        struct hdac_bus *bus = azx_bus(chip);
-       struct hdac_stream *s;
 
-       list_for_each_entry(s, &bus->stream_list, list)
-               snd_hdac_stream_stop(s);
+       snd_hdac_stop_streams(bus);
 }
 EXPORT_SYMBOL_GPL(azx_stop_all_streams);