diff options
Diffstat (limited to 'sound/pci/hda/hda_hwdep.c')
-rw-r--r-- | sound/pci/hda/hda_hwdep.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c index c660383ef381..4af484b8240c 100644 --- a/sound/pci/hda/hda_hwdep.c +++ b/sound/pci/hda/hda_hwdep.c | |||
@@ -155,7 +155,13 @@ int /*__devinit*/ snd_hda_create_hwdep(struct hda_codec *codec) | |||
155 | 155 | ||
156 | static int clear_codec(struct hda_codec *codec) | 156 | static int clear_codec(struct hda_codec *codec) |
157 | { | 157 | { |
158 | snd_hda_codec_reset(codec); | 158 | int err; |
159 | |||
160 | err = snd_hda_codec_reset(codec); | ||
161 | if (err < 0) { | ||
162 | snd_printk(KERN_ERR "The codec is being used, can't free.\n"); | ||
163 | return err; | ||
164 | } | ||
159 | clear_hwdep_elements(codec); | 165 | clear_hwdep_elements(codec); |
160 | return 0; | 166 | return 0; |
161 | } | 167 | } |
@@ -165,7 +171,12 @@ static int reconfig_codec(struct hda_codec *codec) | |||
165 | int err; | 171 | int err; |
166 | 172 | ||
167 | snd_printk(KERN_INFO "hda-codec: reconfiguring\n"); | 173 | snd_printk(KERN_INFO "hda-codec: reconfiguring\n"); |
168 | snd_hda_codec_reset(codec); | 174 | err = snd_hda_codec_reset(codec); |
175 | if (err < 0) { | ||
176 | snd_printk(KERN_ERR | ||
177 | "The codec is being used, can't reconfigure.\n"); | ||
178 | return err; | ||
179 | } | ||
169 | err = snd_hda_codec_configure(codec); | 180 | err = snd_hda_codec_configure(codec); |
170 | if (err < 0) | 181 | if (err < 0) |
171 | return err; | 182 | return err; |