diff options
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 3dc656688c08..97c68dd24ef5 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -3433,11 +3433,16 @@ static struct snd_kcontrol_new spdif_share_sw = { | |||
3433 | int snd_hda_create_spdif_share_sw(struct hda_codec *codec, | 3433 | int snd_hda_create_spdif_share_sw(struct hda_codec *codec, |
3434 | struct hda_multi_out *mout) | 3434 | struct hda_multi_out *mout) |
3435 | { | 3435 | { |
3436 | struct snd_kcontrol *kctl; | ||
3437 | |||
3436 | if (!mout->dig_out_nid) | 3438 | if (!mout->dig_out_nid) |
3437 | return 0; | 3439 | return 0; |
3440 | |||
3441 | kctl = snd_ctl_new1(&spdif_share_sw, mout); | ||
3442 | if (!kctl) | ||
3443 | return -ENOMEM; | ||
3438 | /* ATTENTION: here mout is passed as private_data, instead of codec */ | 3444 | /* ATTENTION: here mout is passed as private_data, instead of codec */ |
3439 | return snd_hda_ctl_add(codec, mout->dig_out_nid, | 3445 | return snd_hda_ctl_add(codec, mout->dig_out_nid, kctl); |
3440 | snd_ctl_new1(&spdif_share_sw, mout)); | ||
3441 | } | 3446 | } |
3442 | EXPORT_SYMBOL_HDA(snd_hda_create_spdif_share_sw); | 3447 | EXPORT_SYMBOL_HDA(snd_hda_create_spdif_share_sw); |
3443 | 3448 | ||