Skip to content

Commit

Permalink
ALSA: hda - Don't register beep input device when no beep is available
Browse files Browse the repository at this point in the history
We check now the availability of PC beep and skip the build of beep
mixers, but the driver still registers the input device.  This should
be checked as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Jul 28, 2010
1 parent 38faddb commit 8af2591
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -10566,10 +10566,12 @@ static int patch_alc882(struct hda_codec *codec)
}
}

err = snd_hda_attach_beep_device(codec, 0x1);
if (err < 0) {
alc_free(codec);
return err;
if (spec->cdefine.enable_pcbeep) {
err = snd_hda_attach_beep_device(codec, 0x1);
if (err < 0) {
alc_free(codec);
return err;
}
}

if (board_config != ALC882_AUTO)
Expand Down Expand Up @@ -12435,7 +12437,7 @@ static int patch_alc262(struct hda_codec *codec)
}
}

if (!spec->no_analog) {
if (!spec->no_analog && spec->cdefine.enable_pcbeep) {
err = snd_hda_attach_beep_device(codec, 0x1);
if (err < 0) {
alc_free(codec);
Expand Down Expand Up @@ -14458,10 +14460,12 @@ static int patch_alc269(struct hda_codec *codec)
}
}

err = snd_hda_attach_beep_device(codec, 0x1);
if (err < 0) {
alc_free(codec);
return err;
if (spec->cdefine.enable_pcbeep) {
err = snd_hda_attach_beep_device(codec, 0x1);
if (err < 0) {
alc_free(codec);
return err;
}
}

if (board_config != ALC269_AUTO)
Expand Down Expand Up @@ -18691,10 +18695,12 @@ static int patch_alc662(struct hda_codec *codec)
}
}

err = snd_hda_attach_beep_device(codec, 0x1);
if (err < 0) {
alc_free(codec);
return err;
if (spec->cdefine.enable_pcbeep) {
err = snd_hda_attach_beep_device(codec, 0x1);
if (err < 0) {
alc_free(codec);
return err;
}
}

if (board_config != ALC662_AUTO)
Expand Down

0 comments on commit 8af2591

Please sign in to comment.