aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_beep.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-07-03 11:35:05 -0400
committerTakashi Iwai <tiwai@suse.de>2012-07-03 12:31:36 -0400
commit257dfb410070b48e377c7894222b73ca41d662e0 (patch)
tree14efd882bcc99d6e23129ab1794a1709fe73a617 /sound/pci/hda/hda_beep.c
parent0401e8548eace5bdb8adfa3e82f56165982cb3ad (diff)
ALSA: hda - Get rid of superfluous beep->mode field
It's no longer necessary since beep_mode=2 option was dropped. It can be checked simply via codec->beep != NULL. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_beep.c')
-rw-r--r--sound/pci/hda/hda_beep.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
index 336b4b3a80b9..e6cf2a22c407 100644
--- a/sound/pci/hda/hda_beep.c
+++ b/sound/pci/hda/hda_beep.c
@@ -184,6 +184,7 @@ EXPORT_SYMBOL_HDA(snd_hda_enable_beep_device);
184int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) 184int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
185{ 185{
186 struct hda_beep *beep; 186 struct hda_beep *beep;
187 int err;
187 188
188 if (!snd_hda_get_bool_hint(codec, "beep")) 189 if (!snd_hda_get_bool_hint(codec, "beep"))
189 return 0; /* disabled explicitly by hints */ 190 return 0; /* disabled explicitly by hints */
@@ -201,19 +202,16 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
201 202
202 beep->nid = nid; 203 beep->nid = nid;
203 beep->codec = codec; 204 beep->codec = codec;
204 beep->mode = codec->beep_mode;
205 codec->beep = beep; 205 codec->beep = beep;
206 206
207 INIT_WORK(&beep->beep_work, &snd_hda_generate_beep); 207 INIT_WORK(&beep->beep_work, &snd_hda_generate_beep);
208 mutex_init(&beep->mutex); 208 mutex_init(&beep->mutex);
209 209
210 if (beep->mode) { 210 err = snd_hda_do_attach(beep);
211 int err = snd_hda_do_attach(beep); 211 if (err < 0) {
212 if (err < 0) { 212 kfree(beep);
213 kfree(beep); 213 codec->beep = NULL;
214 codec->beep = NULL; 214 return err;
215 return err;
216 }
217 } 215 }
218 216
219 return 0; 217 return 0;