Commit 257dfb41 authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarTakashi Iwai <tiwai@suse.de>
parent 0401e854
...@@ -184,6 +184,7 @@ EXPORT_SYMBOL_HDA(snd_hda_enable_beep_device); ...@@ -184,6 +184,7 @@ EXPORT_SYMBOL_HDA(snd_hda_enable_beep_device);
int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
{ {
struct hda_beep *beep; struct hda_beep *beep;
int err;
if (!snd_hda_get_bool_hint(codec, "beep")) if (!snd_hda_get_bool_hint(codec, "beep"))
return 0; /* disabled explicitly by hints */ return 0; /* disabled explicitly by hints */
...@@ -201,19 +202,16 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) ...@@ -201,19 +202,16 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
beep->nid = nid; beep->nid = nid;
beep->codec = codec; beep->codec = codec;
beep->mode = codec->beep_mode;
codec->beep = beep; codec->beep = beep;
INIT_WORK(&beep->beep_work, &snd_hda_generate_beep); INIT_WORK(&beep->beep_work, &snd_hda_generate_beep);
mutex_init(&beep->mutex); mutex_init(&beep->mutex);
if (beep->mode) { err = snd_hda_do_attach(beep);
int err = snd_hda_do_attach(beep); if (err < 0) {
if (err < 0) { kfree(beep);
kfree(beep); codec->beep = NULL;
codec->beep = NULL; return err;
return err;
}
} }
return 0; return 0;
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
struct hda_beep { struct hda_beep {
struct input_dev *dev; struct input_dev *dev;
struct hda_codec *codec; struct hda_codec *codec;
unsigned int mode;
char phys[32]; char phys[32];
int tone; int tone;
hda_nid_t nid; hda_nid_t nid;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment