diff options
author | orion <orion@FreeBSD.org> | 2001-11-21 04:08:10 +0000 |
---|---|---|
committer | orion <orion@FreeBSD.org> | 2001-11-21 04:08:10 +0000 |
commit | 2bfeee833a2b053445f249adab6b5880e360af63 (patch) | |
tree | 6da1b626d2970673206e0d1cdc21bb4baf9b4c6f /sys/dev/sound/pcm/ac97.c | |
parent | dc35e47b82d07d6bac2d59915d4eba96ab76bbeb (diff) | |
download | FreeBSD-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.c | 9 |
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; |