From 04553e63a5a58711ea8510a970d6e754f3348e75 Mon Sep 17 00:00:00 2001 From: Cameron Grant Date: Fri, 26 May 2000 21:42:50 +0000 Subject: if we have a codec init routine, fail the attach if init fails --- sys/dev/sound/pcm/ac97.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sys') 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); -- cgit v1.2.3