From a9dbef8ba07cf1624e640ac7fc588cc9ef308b26 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Tigeot?= Date: Thu, 5 Jul 2012 23:32:37 +0200 Subject: [PATCH] sound: Port to DragonFly - mixer_ioctl_cmd() parameters --- sys/dev/sound/pcm/dsp.c | 12 ++++++------ sys/dev/sound/pcm/mixer.c | 14 ++++++++------ sys/dev/sound/pcm/mixer.h | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 52f9d9d1c6..0b0501af0c 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -454,7 +454,7 @@ dsp_open(struct dev_open_args *ap) int i, error, rderror, wrerror, devtype, wdevunit, rdevunit; /* Kind of impossible.. */ - if (i_dev == NULL || td == NULL) + if (i_dev == NULL) return (ENODEV); d = dsp_get_info(i_dev); @@ -565,7 +565,7 @@ dsp_open(struct dev_open_args *ap) if (DSP_F_READ(flags)) { /* open for read */ rderror = pcm_chnalloc(d, &rdch, PCMDIR_REC, - td->td_proc->p_pid, td->td_proc->p_comm, rdevunit); + curproc->p_pid, curproc->p_comm, rdevunit); if (rderror == 0 && chn_reset(rdch, fmt, spd) != 0) rderror = ENXIO; @@ -603,7 +603,7 @@ dsp_open(struct dev_open_args *ap) if (DSP_F_WRITE(flags)) { /* open for write */ wrerror = pcm_chnalloc(d, &wrch, PCMDIR_PLAY, - td->td_proc->p_pid, td->td_proc->p_comm, wdevunit); + curproc->p_pid, curproc->p_comm, wdevunit); if (wrerror == 0 && chn_reset(wrch, fmt, spd) != 0) wrerror = ENXIO; @@ -1106,7 +1106,7 @@ dsp_ioctl(struct dev_ioctl_args *ap) if (d->mixer_dev != NULL) { PCM_ACQUIRE_QUICK(d); - ret = mixer_ioctl_cmd(d->mixer_dev, cmd, arg, -1, td, + ret = mixer_ioctl_cmd(d->mixer_dev, cmd, arg, -1, MIXER_CMD_DIRECT); PCM_RELEASE_QUICK(d); } else @@ -1846,7 +1846,7 @@ dsp_ioctl(struct dev_ioctl_args *ap) if (d->mixer_dev != NULL) { PCM_ACQUIRE_QUICK(d); - ret = mixer_ioctl_cmd(d->mixer_dev, xcmd, arg, -1, td, + ret = mixer_ioctl_cmd(d->mixer_dev, xcmd, arg, -1, MIXER_CMD_DIRECT); PCM_RELEASE_QUICK(d); } else @@ -1859,7 +1859,7 @@ dsp_ioctl(struct dev_ioctl_args *ap) case SNDCTL_DSP_SET_RECSRC: if (d->mixer_dev != NULL) { PCM_ACQUIRE_QUICK(d); - ret = mixer_ioctl_cmd(d->mixer_dev, cmd, arg, -1, td, + ret = mixer_ioctl_cmd(d->mixer_dev, cmd, arg, -1, MIXER_CMD_DIRECT); PCM_RELEASE_QUICK(d); } else diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index c96a6f2878..da0e27e406 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -1086,7 +1086,7 @@ mixer_close(struct dev_close_args *ap) static int mixer_ioctl_channel(struct cdev *dev, u_long cmd, caddr_t arg, int mode, - struct thread *td, int from) + int from) { struct snddev_info *d; struct snd_mixer *m; @@ -1094,7 +1094,7 @@ mixer_ioctl_channel(struct cdev *dev, u_long cmd, caddr_t arg, int mode, pid_t pid; int j, ret; - if (td == NULL || td->td_proc == NULL) + if (curproc == NULL) return (-1); m = dev->si_drv1; @@ -1113,7 +1113,7 @@ mixer_ioctl_channel(struct cdev *dev, u_long cmd, caddr_t arg, int mode, break; } - pid = td->td_proc->p_pid; + pid = curproc->p_pid; rdch = NULL; wrch = NULL; c = NULL; @@ -1215,11 +1215,11 @@ mixer_ioctl(struct dev_ioctl_args *ap) ret = -1; if (mixer_bypass != 0 && (d->flags & SD_F_VPC)) - ret = mixer_ioctl_channel(i_dev, cmd, arg, mode, td, + ret = mixer_ioctl_channel(i_dev, cmd, arg, mode, MIXER_CMD_CDEV); if (ret == -1) - ret = mixer_ioctl_cmd(i_dev, cmd, arg, mode, td, + ret = mixer_ioctl_cmd(i_dev, cmd, arg, mode, MIXER_CMD_CDEV); PCM_RELEASE_QUICK(d); @@ -1243,7 +1243,7 @@ mixer_mixerinfo(struct snd_mixer *m, mixer_info *mi) */ int mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, - struct thread *td, int from) + int from) { struct snd_mixer *m; int ret = EINVAL, *arg_i = (int *)arg; @@ -1345,7 +1345,9 @@ mixer_clone(void *arg, d = devclass_get_softc(pcm_devclass, snd_unit); if (PCM_REGISTERED(d) && d->mixer_dev != NULL) { *dev = d->mixer_dev; +#if 0 dev_ref(*dev); +#endif } } } diff --git a/sys/dev/sound/pcm/mixer.h b/sys/dev/sound/pcm/mixer.h index fe4a3482c5..1987770565 100644 --- a/sys/dev/sound/pcm/mixer.h +++ b/sys/dev/sound/pcm/mixer.h @@ -36,7 +36,7 @@ int mixer_delete(struct snd_mixer *m); int mixer_init(device_t dev, kobj_class_t cls, void *devinfo); int mixer_uninit(device_t dev); int mixer_reinit(device_t dev); -int mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td, int from); +int mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, int from); int mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo *mi); int mixer_hwvol_init(device_t dev); -- 2.41.0