aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinod Koul <[email protected]>2016-03-15 16:39:23 +0530
committerMark Brown <[email protected]>2016-03-16 10:08:43 +0000
commit4a6c5e6a8d29e4d33858227db9179e91aa8a7407 (patch)
treec6f3069d2c5868cb97b4906adf8eef121606305e
parentd4a6360f19c1c551afcba42be98df04651fab31b (diff)
ALSA: hda: use list macro for parsing on cleanup
It is always better to use list_for_each_entry_safe() while doing cleanup. So use this instead of open coding this in list in snd_hdac_stream_free_all() Signed-off-by: Jeeja KP <[email protected]> Acked-by: Takashi Iwai <[email protected]> Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/hda/ext/hdac_ext_stream.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/hda/ext/hdac_ext_stream.c b/sound/hda/ext/hdac_ext_stream.c
index 023cc4cad5c1..626f3bb24c55 100644
--- a/sound/hda/ext/hdac_ext_stream.c
+++ b/sound/hda/ext/hdac_ext_stream.c
@@ -104,12 +104,11 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_init_all);
*/
void snd_hdac_stream_free_all(struct hdac_ext_bus *ebus)
{
- struct hdac_stream *s;
+ struct hdac_stream *s, *_s;
struct hdac_ext_stream *stream;
struct hdac_bus *bus = ebus_to_hbus(ebus);
- while (!list_empty(&bus->stream_list)) {
- s = list_first_entry(&bus->stream_list, struct hdac_stream, list);
+ list_for_each_entry_safe(s, _s, &bus->stream_list, list) {
stream = stream_to_hdac_ext_stream(s);
snd_hdac_ext_stream_decouple(ebus, stream, false);
list_del(&s->list);