From 9c4e7c63a1ffd51809d3afbe86480ef5a7c79ddd Mon Sep 17 00:00:00 2001 From: Mengdong Lin Date: Thu, 7 Mar 2013 14:11:05 -0500 Subject: [PATCH] --- yaml --- r: 360966 b: refs/heads/master c: 4c7a548a70a44269266858f65c3b5fc9c3ace057 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/hda_codec.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 133d9cd28bed..93ab8d7b4736 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 25336e8ae2d2fa64c9c4cc2c9c28f641134c9fa9 +refs/heads/master: 4c7a548a70a44269266858f65c3b5fc9c3ace057 diff --git a/trunk/sound/pci/hda/hda_codec.c b/trunk/sound/pci/hda/hda_codec.c index 3dc656688c08..97c68dd24ef5 100644 --- a/trunk/sound/pci/hda/hda_codec.c +++ b/trunk/sound/pci/hda/hda_codec.c @@ -3433,11 +3433,16 @@ static struct snd_kcontrol_new spdif_share_sw = { int snd_hda_create_spdif_share_sw(struct hda_codec *codec, struct hda_multi_out *mout) { + struct snd_kcontrol *kctl; + if (!mout->dig_out_nid) return 0; + + kctl = snd_ctl_new1(&spdif_share_sw, mout); + if (!kctl) + return -ENOMEM; /* ATTENTION: here mout is passed as private_data, instead of codec */ - return snd_hda_ctl_add(codec, mout->dig_out_nid, - snd_ctl_new1(&spdif_share_sw, mout)); + return snd_hda_ctl_add(codec, mout->dig_out_nid, kctl); } EXPORT_SYMBOL_HDA(snd_hda_create_spdif_share_sw);