diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-07-03 11:35:05 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-07-03 12:31:36 -0400 |
commit | 257dfb410070b48e377c7894222b73ca41d662e0 (patch) | |
tree | 14efd882bcc99d6e23129ab1794a1709fe73a617 /sound/pci | |
parent | 0401e8548eace5bdb8adfa3e82f56165982cb3ad (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')
-rw-r--r-- | sound/pci/hda/hda_beep.c | 14 | ||||
-rw-r--r-- | sound/pci/hda/hda_beep.h | 1 |
2 files changed, 6 insertions, 9 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); | |||
184 | int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) | 184 | int 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; |
diff --git a/sound/pci/hda/hda_beep.h b/sound/pci/hda/hda_beep.h index 30e79d16f9f8..4dc6933bc655 100644 --- a/sound/pci/hda/hda_beep.h +++ b/sound/pci/hda/hda_beep.h | |||
@@ -31,7 +31,6 @@ | |||
31 | struct hda_beep { | 31 | struct hda_beep { |
32 | struct input_dev *dev; | 32 | struct input_dev *dev; |
33 | struct hda_codec *codec; | 33 | struct hda_codec *codec; |
34 | unsigned int mode; | ||
35 | char phys[32]; | 34 | char phys[32]; |
36 | int tone; | 35 | int tone; |
37 | hda_nid_t nid; | 36 | hda_nid_t nid; |