summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/isa/opl.c
diff options
context:
space:
mode:
authortanimura <tanimura@FreeBSD.org>2002-01-01 17:36:26 +0000
committertanimura <tanimura@FreeBSD.org>2002-01-01 17:36:26 +0000
commita46d1d7f893729bbd95a207f15da7cf72690209c (patch)
tree2bf9e44e75f8effab6b654ff7122f77f882aeee0 /sys/dev/sound/isa/opl.c
parentcfe419eb213db0b2937a261122224454d75db7a4 (diff)
downloadFreeBSD-src-a46d1d7f893729bbd95a207f15da7cf72690209c.zip
FreeBSD-src-a46d1d7f893729bbd95a207f15da7cf72690209c.tar.gz
- Do not uiomove with a mutex locked.
- Move from msleep/wakeup to condvar. - Return either zero or a positive errno value from a function. Return additional result via references. - Unify the typedef of callback functions.
Diffstat (limited to 'sys/dev/sound/isa/opl.c')
-rw-r--r--sys/dev/sound/isa/opl.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sys/dev/sound/isa/opl.c b/sys/dev/sound/isa/opl.c
index 5ebf974..345bebb 100644
--- a/sys/dev/sound/isa/opl.c
+++ b/sys/dev/sound/isa/opl.c
@@ -907,10 +907,13 @@ opl_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td)
}
static int
-opl_callback(mididev_info *devinfo, int reason)
+opl_callback(void *d, int reason)
{
int unit;
sc_p scp;
+ mididev_info *devinfo;
+
+ devinfo = (mididev_info *)d;
mtx_assert(&devinfo->flagqueue_mtx, MA_OWNED);
@@ -948,13 +951,16 @@ opl_callback(mididev_info *devinfo, int reason)
}
static int
-opl_readraw(mididev_info *md, u_char *buf, int len, int nonblock)
+opl_readraw(mididev_info *md, u_char *buf, int len, int *lenr, int nonblock)
{
sc_p scp;
int unit;
if (md == NULL)
return (ENXIO);
+ if (lenr == NULL)
+ return (EINVAL);
+
unit = md->unit;
scp = md->softc;
if ((md->fflags & FREAD) == 0) {
@@ -963,17 +969,22 @@ opl_readraw(mididev_info *md, u_char *buf, int len, int nonblock)
}
/* NOP. */
+ *lenr = 0;
+
return (0);
}
static int
-opl_writeraw(mididev_info *md, u_char *buf, int len, int nonblock)
+opl_writeraw(mididev_info *md, u_char *buf, int len, int *lenw, int nonblock)
{
sc_p scp;
int unit;
if (md == NULL)
return (ENXIO);
+ if (lenw == NULL)
+ return (EINVAL);
+
unit = md->unit;
scp = md->softc;
if ((md->fflags & FWRITE) == 0) {
@@ -982,6 +993,8 @@ opl_writeraw(mididev_info *md, u_char *buf, int len, int nonblock)
}
/* NOP. */
+ *lenw = 0;
+
return (0);
}
OpenPOWER on IntegriCloud