summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pcm/ac97.c
diff options
context:
space:
mode:
authorcg <cg@FreeBSD.org>2000-05-26 21:42:50 +0000
committercg <cg@FreeBSD.org>2000-05-26 21:42:50 +0000
commit437ef4fa6ba262ce20066357dbea90981432de21 (patch)
tree44870f12d7fbb47e322c403c1d8d8b81c7638baf /sys/dev/sound/pcm/ac97.c
parent7a420274fbed079ac250b4ae0c7b855019210ad1 (diff)
downloadFreeBSD-src-437ef4fa6ba262ce20066357dbea90981432de21.zip
FreeBSD-src-437ef4fa6ba262ce20066357dbea90981432de21.tar.gz
if we have a codec init routine, fail the attach if init fails
Diffstat (limited to 'sys/dev/sound/pcm/ac97.c')
-rw-r--r--sys/dev/sound/pcm/ac97.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/sound/pcm/ac97.c b/sys/dev/sound/pcm/ac97.c
index a8a3a11..8432769 100644
--- a/sys/dev/sound/pcm/ac97.c
+++ b/sys/dev/sound/pcm/ac97.c
@@ -93,7 +93,7 @@ static struct ac97_codecid ac97codecid[] = {
};
static char *ac97enhancement[] = {
- "",
+ "no 3D Stereo Enhancement",
"Analog Devices Phat Stereo",
"Creative Stereo Enhancement",
"National Semi 3D Stereo Enhancement",
@@ -299,8 +299,12 @@ ac97_initmixer(struct ac97_info *codec)
for (i = 0; i < 32; i++)
codec->mix[i] = ac97mixtable_default[i];
- if (codec->init)
- codec->init(codec->devinfo);
+ if (codec->init) {
+ if (codec->init(codec->devinfo)) {
+ device_printf(codec->dev, "ac97 codec init failed\n");
+ return ENODEV;
+ }
+ }
wrcd(codec, AC97_REG_POWER, 0);
wrcd(codec, AC97_REG_RESET, 0);
DELAY(100000);
OpenPOWER on IntegriCloud