summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pcm/ac97.c
diff options
context:
space:
mode:
authororion <orion@FreeBSD.org>2001-11-21 04:08:10 +0000
committerorion <orion@FreeBSD.org>2001-11-21 04:08:10 +0000
commit2bfeee833a2b053445f249adab6b5880e360af63 (patch)
tree6da1b626d2970673206e0d1cdc21bb4baf9b4c6f /sys/dev/sound/pcm/ac97.c
parentdc35e47b82d07d6bac2d59915d4eba96ab76bbeb (diff)
downloadFreeBSD-src-2bfeee833a2b053445f249adab6b5880e360af63.zip
FreeBSD-src-2bfeee833a2b053445f249adab6b5880e360af63.tar.gz
Emit a warning if invalid mode passed to ac97_setextmode.
MFC after: 3 days
Diffstat (limited to 'sys/dev/sound/pcm/ac97.c')
-rw-r--r--sys/dev/sound/pcm/ac97.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/sound/pcm/ac97.c b/sys/dev/sound/pcm/ac97.c
index 545f19d..5f6ccd0 100644
--- a/sys/dev/sound/pcm/ac97.c
+++ b/sys/dev/sound/pcm/ac97.c
@@ -206,10 +206,10 @@ ac97_setrate(struct ac97_info *codec, int which, int rate)
u_int16_t v;
switch(which) {
- case AC97_REGEXT_FDACRATE:
+ case AC97_REGEXT_FDACRATE:
case AC97_REGEXT_SDACRATE:
case AC97_REGEXT_LDACRATE:
- case AC97_REGEXT_LADCRATE:
+ case AC97_REGEXT_LADCRATE:
case AC97_REGEXT_MADCRATE:
break;
@@ -235,8 +235,11 @@ int
ac97_setextmode(struct ac97_info *codec, u_int16_t mode)
{
mode &= AC97_EXTCAPS;
- if ((mode & ~codec->extcaps) != 0)
+ if ((mode & ~codec->extcaps) != 0) {
+ device_printf(codec->dev, "ac97 invalid mode set 0x%04x\n",
+ mode);
return -1;
+ }
snd_mtxlock(codec->lock);
wrcd(codec, AC97_REGEXT_STAT, mode);
codec->extstat = rdcd(codec, AC97_REGEXT_STAT) & AC97_EXTCAPS;
OpenPOWER on IntegriCloud