Merge tag 'asoc-v5.16' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[linux-2.6-microblaze.git] / sound / soc / sof / intel / hda-dai.c
index dfd2df0..7657938 100644 (file)
@@ -72,6 +72,7 @@ static struct hdac_ext_stream *
                return NULL;
        }
 
+       spin_lock_irq(&bus->reg_lock);
        list_for_each_entry(stream, &bus->stream_list, list) {
                struct hdac_ext_stream *hstream =
                        stream_to_hdac_ext_stream(stream);
@@ -111,12 +112,12 @@ static struct hdac_ext_stream *
                 * is updated in snd_hdac_ext_stream_decouple().
                 */
                if (!res->decoupled)
-                       snd_hdac_ext_stream_decouple(bus, res, true);
-               spin_lock_irq(&bus->reg_lock);
+                       snd_hdac_ext_stream_decouple_locked(bus, res, true);
+
                res->link_locked = 1;
                res->link_substream = substream;
-               spin_unlock_irq(&bus->reg_lock);
        }
+       spin_unlock_irq(&bus->reg_lock);
 
        return res;
 }