diff options
Diffstat (limited to 'sys/dev/sound/isa/opl.c')
-rw-r--r-- | sys/dev/sound/isa/opl.c | 19 |
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); } |