diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2008-10-25 22:30:44 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2008-10-25 22:30:44 +0000 |
commit | fe8114f730e5473eba5ee55c81c541e29edbeea8 (patch) | |
tree | 545de71dde8d0a2e03bc8556eeaa4beb581824dd /sys/dev/pci/maestro.c | |
parent | d54880b2f6a9ada7238d4417b82adb8ce1f2ae77 (diff) |
audio(9) says low level drivers are allowed to change the requested
values of the audio_params structure during AUDIO_SETINFO if the
hardware cannot be set to exactly the requested mode.
some drivers do this sometimes. others always return EINVAL if there
isn't an exact match.
be more consistent. only return EINVAL if an absurd parameter was
requested, otherwise return a supported set of parameters, as close
as possible to what was requested.
with/ok ratchov@
Diffstat (limited to 'sys/dev/pci/maestro.c')
-rw-r--r-- | sys/dev/pci/maestro.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/pci/maestro.c b/sys/dev/pci/maestro.c index 0fadf6321fc..a8751dbd8e0 100644 --- a/sys/dev/pci/maestro.c +++ b/sys/dev/pci/maestro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: maestro.c,v 1.25 2008/05/29 02:10:01 jakemsr Exp $ */ +/* $OpenBSD: maestro.c,v 1.26 2008/10/25 22:30:43 jakemsr Exp $ */ /* $FreeBSD: /c/ncvs/src/sys/dev/sound/pci/maestro.c,v 1.3 2000/11/21 12:22:11 julian Exp $ */ /* * FreeBSD's ESS Agogo/Maestro driver @@ -1090,9 +1090,8 @@ maestro_set_params(hdl, setmode, usemode, play, rec) play->factor = 1; play->sw_code = NULL; - if (play->channels != 1 && play->channels != 2) - return (EINVAL); - + if (play->channels > 2) + play->channels = 2; sc->play.mode = MAESTRO_PLAY; if (play->channels == 2) |