Merge tag 'sound-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
[linux-block.git] / sound / pci / hda / patch_hdmi.c
index 5c6980394dcec2e2d92730e0cbb54eb7b73f2277..ee051bdfaff6f7dd69e880145b96e3f172a9143d 100644 (file)
@@ -2104,10 +2104,6 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
                goto unlock;
        }
 
-       if (snd_BUG_ON(pin_idx < 0)) {
-               err = -EINVAL;
-               goto unlock;
-       }
        per_pin = get_pin(spec, pin_idx);
 
        /* Verify pin:cvt selections to avoid silent audio after S3.
@@ -2199,13 +2195,13 @@ static int hdmi_pcm_close(struct hda_pcm_stream *hinfo,
                snd_hda_spdif_ctls_unassign(codec, pcm_idx);
                clear_bit(pcm_idx, &spec->pcm_in_use);
                pin_idx = hinfo_to_pin_index(codec, hinfo);
+               /*
+                * In such a case, return 0 to match the behavior in
+                * hdmi_pcm_open()
+                */
                if (pin_idx < 0)
                        goto unlock;
 
-               if (snd_BUG_ON(pin_idx < 0)) {
-                       err = -EINVAL;
-                       goto unlock;
-               }
                per_pin = get_pin(spec, pin_idx);
 
                if (spec->dyn_pin_out) {