aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorCameron Grant <cg@FreeBSD.org>2000-05-26 21:42:50 +0000
committerCameron Grant <cg@FreeBSD.org>2000-05-26 21:42:50 +0000
commit04553e63a5a58711ea8510a970d6e754f3348e75 (patch)
tree37a04d3129f546c315059d3b219d5711e01c7544 /sys
parent7795d191329ee2d7cea4a6de4335feb006fd7fc2 (diff)
downloadsrc-04553e63a5a58711ea8510a970d6e754f3348e75.tar.gz
src-04553e63a5a58711ea8510a970d6e754f3348e75.zip
if we have a codec init routine, fail the attach if init fails
Notes
Notes: svn path=/head/; revision=60960
Diffstat (limited to 'sys')
-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 a8a3a11cd0ba..8432769934bf 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);