summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2006-08-30 01:14:24 +0000
committerchristos <christos@NetBSD.org>2006-08-30 01:14:24 +0000
commitd76c7ff74aa92ba065ed09ce3b733c6b9451a396 (patch)
tree8164637d92f1dd92f248baba0171f8315de44b37 /sys/dev
parentb80f5be1eb0aba3f07718e20366fd8241152af24 (diff)
- fix missing initializer
- fix < 0 comparison with unsigned
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/eso.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/eso.c b/sys/dev/pci/eso.c
index f9050f8a81d..9d0296f7d68 100644
--- a/sys/dev/pci/eso.c
+++ b/sys/dev/pci/eso.c
@@ -1,4 +1,4 @@
-/* $NetBSD: eso.c,v 1.42 2006/04/14 19:03:32 christos Exp $ */
+/* $NetBSD: eso.c,v 1.43 2006/08/30 01:14:24 christos Exp $ */
/*
* Copyright (c) 1999, 2000, 2004 Klaus J. Klein
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: eso.c,v 1.42 2006/04/14 19:03:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: eso.c,v 1.43 2006/08/30 01:14:24 christos Exp $");
#include "mpu.h"
@@ -154,6 +154,7 @@ static const struct audio_hw_if eso_hw_if = {
eso_trigger_output,
eso_trigger_input,
NULL, /* dev_ioctl */
+ NULL, /* powerstate */
};
static const char * const eso_rev2model[] = {
@@ -749,7 +750,10 @@ eso_set_params(void *hdl, int setmode, int usemode, audio_params_t *play,
r[1] = ESO_CLK1 /
(128 - (rd[1] = 128 - ESO_CLK1 / p->sample_rate));
- clk = ABS(p->sample_rate - r[0]) > ABS(p->sample_rate - r[1]);
+ if (r[0] > r[1])
+ clk = p->sample_rate - r[1];
+ else
+ clk = p->sample_rate - r[0];
srg = rd[clk] | (clk == 1 ? ESO_CLK1_SELECT : 0x00);
/* Roll-off frequency of 87%, as in the ES1888 driver. */