AC_VERB_SET_DIGI_CONVERT_2,
val >> 8);
- for (d = codec->slave_dig_outs; *d; d++) {
- snd_hda_codec_write_cache(codec, *d, 0,
+ if (codec->slave_dig_outs)
+ for (d = codec->slave_dig_outs; *d; d++) {
+ snd_hda_codec_write_cache(codec, *d, 0,
AC_VERB_SET_DIGI_CONVERT_1,
val & 0xff);
- snd_hda_codec_write_cache(codec, *d, 0,
+ snd_hda_codec_write_cache(codec, *d, 0,
AC_VERB_SET_DIGI_CONVERT_2,
val >> 8);
- }
+ }
}
mutex_unlock(&codec->spdif_mutex);
AC_VERB_SET_DIGI_CONVERT_1,
val & 0xff);
- for (d = codec->slave_dig_outs; *d; d++)
- snd_hda_codec_write_cache(codec, *d, 0,
+ if (codec->slave_dig_outs)
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write_cache(codec, *d, 0,
AC_VERB_SET_DIGI_CONVERT_1,
val & 0xff);
/* unmute amp switch (if any) */
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_DIGI_CONVERT_1, val);
- for (d = codec->slave_dig_outs; *d; d++)
- snd_hda_codec_write_cache(codec, *d, 0,
+ if (codec->slave_dig_outs)
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write_cache(codec, *d, 0,
AC_VERB_SET_DIGI_CONVERT_1, val);
}
mutex_unlock(&codec->spdif_mutex);
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1,
codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff);
- for (d = codec->slave_dig_outs; *d; d++)
- snd_hda_codec_write(codec, *d, 0,
- AC_VERB_SET_DIGI_CONVERT_1,
+ if (codec->slave_dig_outs)
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_1,
codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff);
}
snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format);
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1,
codec->spdif_ctls & 0xff);
- for (d = codec->slave_dig_outs; *d; d++)
- snd_hda_codec_write(codec, *d, 0,
- AC_VERB_SET_DIGI_CONVERT_1,
+ if (codec->slave_dig_outs)
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_1,
codec->spdif_ctls & 0xff);
}