strict signatures for kobj methods in sound subsystem

Andriy Gapon avg at icyb.net.ua
Wed Apr 15 11:06:19 PDT 2009


Please review the attached, largely mechanical, patch for sound subsystem.
This patch is supposed to make all functions that implement kobj methods have
strictly the same signatures as defined by the interfaces.

The only non-mechanical change is in sys/dev/sound/pcm/channel_if.m: usage of
setformat method in channel.c shows that this method is supposed to return error
number and so int is more appropriate return type than u_int32_t.
E.g.:
                 r = CHANNEL_SETFORMAT(c->methods, c->devinfo, sndbuf_getfmt(b));
                 if (r == 0)
                         r = chn_tryspeed(c, c->speed);
         }
         return r;
 } else
         return EINVAL;


-- 
Andriy Gapon
-------------- next part --------------
diff --git a/sys/dev/sound/isa/ad1816.c b/sys/dev/sound/isa/ad1816.c
index 4c5ecab..7237784 100644
--- a/sys/dev/sound/isa/ad1816.c
+++ b/sys/dev/sound/isa/ad1816.c
@@ -269,7 +269,7 @@ ad1816mix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
     	return left | (right << 8);
 }
 
-static int
+static u_int32_t
 ad1816mix_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
 	struct ad1816_info *ad1816 = mix_getdevinfo(m);
@@ -382,7 +382,7 @@ ad1816chan_setformat(kobj_t obj, void *data, u_int32_t format)
 #endif
 }
 
-static int
+static u_int32_t
 ad1816chan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct ad1816_chinfo *ch = data;
@@ -395,7 +395,7 @@ ad1816chan_setspeed(kobj_t obj, void *data, u_int32_t speed)
     	return speed;
 }
 
-static int
+static u_int32_t
 ad1816chan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct ad1816_chinfo *ch = data;
@@ -456,7 +456,7 @@ ad1816chan_trigger(kobj_t obj, void *data, int go)
     	return 0;
 }
 
-static int
+static u_int32_t
 ad1816chan_getptr(kobj_t obj, void *data)
 {
 	struct ad1816_chinfo *ch = data;
diff --git a/sys/dev/sound/isa/ess.c b/sys/dev/sound/isa/ess.c
index 4e59777..98e1ac7 100644
--- a/sys/dev/sound/isa/ess.c
+++ b/sys/dev/sound/isa/ess.c
@@ -583,7 +583,7 @@ esschan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 esschan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct ess_chinfo *ch = data;
@@ -597,7 +597,7 @@ esschan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return ch->spd;
 }
 
-static int
+static u_int32_t
 esschan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct ess_chinfo *ch = data;
@@ -630,7 +630,7 @@ esschan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 esschan_getptr(kobj_t obj, void *data)
 {
 	struct ess_chinfo *ch = data;
@@ -741,7 +741,7 @@ essmix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
     	return left | (right << 8);
 }
 
-static int
+static u_int32_t
 essmix_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
     	struct ess_info *sc = mix_getdevinfo(m);
diff --git a/sys/dev/sound/isa/mss.c b/sys/dev/sound/isa/mss.c
index 411296b..86cb801 100644
--- a/sys/dev/sound/isa/mss.c
+++ b/sys/dev/sound/isa/mss.c
@@ -520,7 +520,7 @@ mssmix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 	return left | (right << 8);
 }
 
-static int
+static u_int32_t
 mssmix_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
 	struct mss_info *mss = mix_getdevinfo(m);
@@ -604,7 +604,7 @@ ymmix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 	return left | (right << 8);
 }
 
-static int
+static u_int32_t
 ymmix_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
 	struct mss_info *mss = mix_getdevinfo(m);
@@ -1170,7 +1170,7 @@ msschan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 msschan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct mss_chinfo *ch = data;
@@ -1184,7 +1184,7 @@ msschan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return r;
 }
 
-static int
+static u_int32_t
 msschan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct mss_chinfo *ch = data;
@@ -1211,7 +1211,7 @@ msschan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 msschan_getptr(kobj_t obj, void *data)
 {
 	struct mss_chinfo *ch = data;
diff --git a/sys/dev/sound/isa/sb16.c b/sys/dev/sound/isa/sb16.c
index eb37337..e57ce6d 100644
--- a/sys/dev/sound/isa/sb16.c
+++ b/sys/dev/sound/isa/sb16.c
@@ -366,7 +366,7 @@ sb16mix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
     	return left | (right << 8);
 }
 
-static int
+static u_int32_t
 sb16mix_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
     	struct sb_info *sb = mix_getdevinfo(m);
@@ -700,7 +700,7 @@ sb16chan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 sb16chan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct sb_chinfo *ch = data;
@@ -709,7 +709,7 @@ sb16chan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return speed;
 }
 
-static int
+static u_int32_t
 sb16chan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct sb_chinfo *ch = data;
@@ -737,7 +737,7 @@ sb16chan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 sb16chan_getptr(kobj_t obj, void *data)
 {
 	struct sb_chinfo *ch = data;
diff --git a/sys/dev/sound/isa/sb8.c b/sys/dev/sound/isa/sb8.c
index 3b0f295..7347c63 100644
--- a/sys/dev/sound/isa/sb8.c
+++ b/sys/dev/sound/isa/sb8.c
@@ -372,7 +372,7 @@ sbpromix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
     	return left | (right << 8);
 }
 
-static int
+static u_int32_t
 sbpromix_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
     	struct sb_info *sb = mix_getdevinfo(m);
@@ -453,7 +453,7 @@ sbmix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
     	return left | (left << 8);
 }
 
-static int
+static u_int32_t
 sbmix_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
 	return 0;
@@ -614,7 +614,7 @@ sbchan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 sbchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct sb_chinfo *ch = data;
@@ -623,7 +623,7 @@ sbchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return sb_speed(ch);
 }
 
-static int
+static u_int32_t
 sbchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct sb_chinfo *ch = data;
@@ -648,7 +648,7 @@ sbchan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 sbchan_getptr(kobj_t obj, void *data)
 {
 	struct sb_chinfo *ch = data;
diff --git a/sys/dev/sound/macio/aoa.c b/sys/dev/sound/macio/aoa.c
index 54efe4f..61a3d71 100644
--- a/sys/dev/sound/macio/aoa.c
+++ b/sys/dev/sound/macio/aoa.c
@@ -138,7 +138,7 @@ aoa_dma_delete(struct aoa_dma *dma)
 	free(dma, M_DEVBUF);
 }
 
-static int
+static u_int32_t
 aoa_chan_setblocksize(kobj_t obj, void *data, u_int32_t blocksz)
 {
 	struct aoa_dma 		*dma = data;
@@ -192,7 +192,7 @@ aoa_chan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return (0);
 }
 
-static int
+static u_int32_t
 aoa_chan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	DPRINTF(("aoa_chan_setspeed: speed = %u\n", speed));
@@ -200,7 +200,7 @@ aoa_chan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return (44100);
 }
 
-static int
+static u_int32_t
 aoa_chan_getptr(kobj_t obj, void *data)
 {
 	struct aoa_dma 	 *dma = data;
diff --git a/sys/dev/sound/macio/davbus.c b/sys/dev/sound/macio/davbus.c
index 15909f8..1afb7ee 100644
--- a/sys/dev/sound/macio/davbus.c
+++ b/sys/dev/sound/macio/davbus.c
@@ -115,7 +115,7 @@ static void	burgundy_set_outputs(struct davbus_softc *d, u_int mask);
 static u_int	burgundy_read_status(struct davbus_softc *d, u_int status);
 static int	burgundy_set(struct snd_mixer *m, unsigned dev, unsigned left,
 		    unsigned right);
-static int	burgundy_setrecsrc(struct snd_mixer *m, u_int32_t src);
+static u_int32_t	burgundy_setrecsrc(struct snd_mixer *m, u_int32_t src);
 
 static kobj_method_t burgundy_mixer_methods[] = {
 	KOBJMETHOD(mixer_init, 		burgundy_init),
@@ -293,7 +293,7 @@ burgundy_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 	return (0);
 }
 
-static int
+static u_int32_t
 burgundy_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
 	return (0);
@@ -311,7 +311,7 @@ static void	screamer_set_outputs(struct davbus_softc *d, u_int mask);
 static u_int	screamer_read_status(struct davbus_softc *d, u_int status);
 static int	screamer_set(struct snd_mixer *m, unsigned dev, unsigned left,
 		    unsigned right);
-static int	screamer_setrecsrc(struct snd_mixer *m, u_int32_t src);
+static u_int32_t screamer_setrecsrc(struct snd_mixer *m, u_int32_t src);
 
 static kobj_method_t screamer_mixer_methods[] = {
 	KOBJMETHOD(mixer_init, 		screamer_init),
@@ -479,7 +479,7 @@ screamer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 	return (0);
 }
 
-static int
+static u_int32_t
 screamer_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
 	return (0);
diff --git a/sys/dev/sound/macio/snapper.c b/sys/dev/sound/macio/snapper.c
index 8acca10..f906b18 100644
--- a/sys/dev/sound/macio/snapper.c
+++ b/sys/dev/sound/macio/snapper.c
@@ -90,11 +90,11 @@ struct snapper_softc
 static int	snapper_probe(device_t);
 static int 	snapper_attach(device_t);
 static int	snapper_init(struct snd_mixer *m);
-static void	snapper_uninit(struct snd_mixer *m);
+static int	snapper_uninit(struct snd_mixer *m);
 static int	snapper_reinit(struct snd_mixer *m);
 static int	snapper_set(struct snd_mixer *m, unsigned dev, unsigned left,
 		    unsigned right);
-static int	snapper_setrecsrc(struct snd_mixer *m, u_int32_t src);
+static u_int32_t	snapper_setrecsrc(struct snd_mixer *m, u_int32_t src);
 
 static device_method_t snapper_methods[] = {
 	/* Device interface. */
@@ -417,10 +417,10 @@ snapper_init(struct snd_mixer *m)
 	return (0);
 }
 
-static void
+static int
 snapper_uninit(struct snd_mixer *m)
 {
-	return;
+	return (0);
 }
 
 static int
@@ -478,7 +478,7 @@ snapper_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 	return (0);
 }
 
-static int
+static u_int32_t
 snapper_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
 	return (0);
diff --git a/sys/dev/sound/macio/tumbler.c b/sys/dev/sound/macio/tumbler.c
index 3007ece..fbc0ef9 100644
--- a/sys/dev/sound/macio/tumbler.c
+++ b/sys/dev/sound/macio/tumbler.c
@@ -90,11 +90,11 @@ struct tumbler_softc
 static int	tumbler_probe(device_t);
 static int 	tumbler_attach(device_t);
 static int	tumbler_init(struct snd_mixer *m);
-static void	tumbler_uninit(struct snd_mixer *m);
+static int	tumbler_uninit(struct snd_mixer *m);
 static int	tumbler_reinit(struct snd_mixer *m);
 static int	tumbler_set(struct snd_mixer *m, unsigned dev, unsigned left,
 		    unsigned right);
-static int	tumbler_setrecsrc(struct snd_mixer *m, u_int32_t src);
+static u_int32_t	tumbler_setrecsrc(struct snd_mixer *m, u_int32_t src);
 
 static device_method_t tumbler_methods[] = {
 	/* Device interface. */
@@ -363,10 +363,10 @@ tumbler_init(struct snd_mixer *m)
 	return (0);
 }
 
-static void
+static int
 tumbler_uninit(struct snd_mixer *m)
 {
-	return;
+	return (0);
 }
 
 static int
@@ -424,7 +424,7 @@ tumbler_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 	return (0);
 }
 
-static int
+static u_int32_t
 tumbler_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
 	return (0);
diff --git a/sys/dev/sound/midi/mpu401.c b/sys/dev/sound/midi/mpu401.c
index dfdf969..e69caf6 100644
--- a/sys/dev/sound/midi/mpu401.c
+++ b/sys/dev/sound/midi/mpu401.c
@@ -75,14 +75,14 @@ struct mpu401 {
 static void mpu401_timeout(void *m);
 static mpu401_intr_t mpu401_intr;
 
-static int mpu401_minit(kobj_t obj, struct mpu401 *m);
-static int mpu401_muninit(kobj_t obj, struct mpu401 *m);
-static int mpu401_minqsize(kobj_t obj, struct mpu401 *m);
-static int mpu401_moutqsize(kobj_t obj, struct mpu401 *m);
-static void mpu401_mcallback(kobj_t obj, struct mpu401 *m, int flags);
-static void mpu401_mcallbackp(kobj_t obj, struct mpu401 *m, int flags);
-static const char *mpu401_mdescr(kobj_t obj, struct mpu401 *m, int verbosity);
-static const char *mpu401_mprovider(kobj_t obj, struct mpu401 *m);
+static int mpu401_minit(struct snd_midi *obj, void *m);
+static int mpu401_muninit(struct snd_midi *obj, void *m);
+static int mpu401_minqsize(struct snd_midi *obj, void *m);
+static int mpu401_moutqsize(struct snd_midi *obj, void *m);
+static void mpu401_mcallback(struct snd_midi *obj, void *m, int flags);
+static void mpu401_mcallbackp(struct snd_midi *obj, void *m, int flags);
+static const char *mpu401_mdescr(struct snd_midi *obj, void *m, int verbosity);
+static const char *mpu401_mprovider(struct snd_midi *obj, void *m);
 
 static kobj_method_t mpu401_methods[] = {
 	KOBJMETHOD(mpu_init, mpu401_minit),
@@ -208,8 +208,9 @@ mpu401_uninit(struct mpu401 *m)
 }
 
 static int
-mpu401_minit(kobj_t obj, struct mpu401 *m)
+mpu401_minit(struct snd_midi *obj, void *cookie)
 {
+	struct mpu401 *m = cookie;
 	int i;
 
 	CMD(m, MPU_RESET);
@@ -232,27 +233,30 @@ mpu401_minit(kobj_t obj, struct mpu401 *m)
 
 
 int
-mpu401_muninit(kobj_t obj, struct mpu401 *m)
+mpu401_muninit(struct snd_midi *obj, void *cookie)
 {
+	struct mpu401 *m = cookie;
 
 	return MPUFOI_UNINIT(m, m->cookie);
 }
 
 int
-mpu401_minqsize(kobj_t obj, struct mpu401 *m)
+mpu401_minqsize(struct snd_midi *obj, void *cookie)
 {
 	return 128;
 }
 
 int
-mpu401_moutqsize(kobj_t obj, struct mpu401 *m)
+mpu401_moutqsize(struct snd_midi *obj, void *cookie)
 {
 	return 128;
 }
 
 static void
-mpu401_mcallback(kobj_t obj, struct mpu401 *m, int flags)
+mpu401_mcallback(struct snd_midi *obj, void *cookie, int flags)
 {
+	struct mpu401 *m = cookie;
+
 #if 0
 	printf("mpu401_callback %s %s %s %s\n",
 	    flags & M_RX ? "M_RX" : "",
@@ -267,21 +271,23 @@ mpu401_mcallback(kobj_t obj, struct mpu401 *m, int flags)
 }
 
 static void
-mpu401_mcallbackp(kobj_t obj, struct mpu401 *m, int flags)
+mpu401_mcallbackp(struct snd_midi *obj, void *cookie, int flags)
 {
+	struct mpu401 *m = cookie;
+
 /*	printf("mpu401_callbackp\n"); */
 	mpu401_mcallback(obj, m, flags);
 }
 
 static const char *
-mpu401_mdescr(kobj_t obj, struct mpu401 *m, int verbosity)
+mpu401_mdescr(struct snd_midi *obj, void *cookie, int verbosity)
 {
 
 	return "descr mpu401";
 }
 
 static const char *
-mpu401_mprovider(kobj_t obj, struct mpu401 *m)
+mpu401_mprovider(struct snd_midi *obj, void *cookie)
 {
 	return "provider mpu401";
 }
diff --git a/sys/dev/sound/pci/als4000.c b/sys/dev/sound/pci/als4000.c
index 6df5ffd..43e9e39 100644
--- a/sys/dev/sound/pci/als4000.c
+++ b/sys/dev/sound/pci/als4000.c
@@ -236,7 +236,7 @@ alschan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 alschan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct	sc_chinfo *ch = data, *other;
@@ -254,7 +254,7 @@ alschan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return speed;
 }
 
-static int
+static u_int32_t
 alschan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct	sc_chinfo *ch = data;
@@ -267,7 +267,7 @@ alschan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 	return blocksize;
 }
 
-static int
+static u_int32_t
 alschan_getptr(kobj_t obj, void *data)
 {
 	struct sc_chinfo *ch = data;
@@ -594,7 +594,7 @@ alsmix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 	return 0;
 }
 
-static int
+static u_int32_t
 alsmix_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
 	struct sc_info *sc = mix_getdevinfo(m);
diff --git a/sys/dev/sound/pci/atiixp.c b/sys/dev/sound/pci/atiixp.c
index 6ec50ba..355dde5 100644
--- a/sys/dev/sound/pci/atiixp.c
+++ b/sys/dev/sound/pci/atiixp.c
@@ -187,13 +187,13 @@ static int atiixp_wrcd(kobj_t, void *, int, uint32_t);
 static void  *atiixp_chan_init(kobj_t, void *, struct snd_dbuf *,
 						struct pcm_channel *, int);
 static int    atiixp_chan_setformat(kobj_t, void *, uint32_t);
-static int    atiixp_chan_setspeed(kobj_t, void *, uint32_t);
+static uint32_t atiixp_chan_setspeed(kobj_t, void *, uint32_t);
 static int    atiixp_chan_setfragments(kobj_t, void *, uint32_t, uint32_t);
-static int    atiixp_chan_setblocksize(kobj_t, void *, uint32_t);
+static uint32_t atiixp_chan_setblocksize(kobj_t, void *, uint32_t);
 static void   atiixp_buildsgdt(struct atiixp_chinfo *);
 static int    atiixp_chan_trigger(kobj_t, void *, int);
 static __inline uint32_t atiixp_dmapos(struct atiixp_chinfo *);
-static int    atiixp_chan_getptr(kobj_t, void *);
+static uint32_t atiixp_chan_getptr(kobj_t, void *);
 static struct pcmchan_caps *atiixp_chan_getcaps(kobj_t, void *);
 
 static void atiixp_intr(void *);
@@ -515,7 +515,7 @@ atiixp_chan_setformat(kobj_t obj, void *data, uint32_t format)
 	return (0);
 }
 
-static int
+static uint32_t
 atiixp_chan_setspeed(kobj_t obj, void *data, uint32_t spd)
 {
 	/* XXX We're supposed to do VRA/DRA processing right here */
@@ -561,7 +561,7 @@ atiixp_chan_setfragments(kobj_t obj, void *data,
 	return (1);
 }
 
-static int
+static uint32_t
 atiixp_chan_setblocksize(kobj_t obj, void *data, uint32_t blksz)
 {
 	struct atiixp_chinfo *ch = data;
@@ -818,7 +818,7 @@ atiixp_chan_trigger(kobj_t obj, void *data, int go)
 	return (0);
 }
 
-static int
+static uint32_t
 atiixp_chan_getptr(kobj_t obj, void *data)
 {
 	struct atiixp_chinfo *ch = data;
diff --git a/sys/dev/sound/pci/cmi.c b/sys/dev/sound/pci/cmi.c
index cda1e82..f5d1034 100644
--- a/sys/dev/sound/pci/cmi.c
+++ b/sys/dev/sound/pci/cmi.c
@@ -409,7 +409,7 @@ cmichan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 cmichan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct sc_chinfo *ch = data;
@@ -455,7 +455,7 @@ cmichan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return ch->spd;
 }
 
-static int
+static u_int32_t
 cmichan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct sc_chinfo *ch = data;
@@ -505,7 +505,7 @@ cmichan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 cmichan_getptr(kobj_t obj, void *data)
 {
 	struct sc_chinfo	*ch = data;
@@ -714,7 +714,7 @@ cmimix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 	return 0;
 }
 
-static int
+static u_int32_t
 cmimix_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
 	struct sc_info *sc = mix_getdevinfo(m);
@@ -775,7 +775,7 @@ MIXER_DECLARE(cmi_mixer);
  */
 
 static unsigned char
-cmi_mread(void *arg, struct sc_info *sc, int reg)
+cmi_mread(struct mpu401 *arg, void *unused, int reg)
 {	
 	unsigned int d;
 
@@ -786,15 +786,16 @@ cmi_mread(void *arg, struct sc_info *sc, int reg)
 }
 
 static void
-cmi_mwrite(void *arg, struct sc_info *sc, int reg, unsigned char b)
+cmi_mwrite(struct mpu401 *arg, void *unused, int reg, unsigned char b)
 {
 
 	bus_space_write_1(0,0,0x330 + reg , b);
 }
 
 static int
-cmi_muninit(void *arg, struct sc_info *sc)
+cmi_muninit(struct mpu401 *arg, void *cookie)
 {
+	struct sc_info *sc = cookie;
 
 	snd_mtxlock(sc->lock);
 	sc->mpu_intr = 0;
diff --git a/sys/dev/sound/pci/cs4281.c b/sys/dev/sound/pci/cs4281.c
index 5b4b821..5ae1b59 100644
--- a/sys/dev/sound/pci/cs4281.c
+++ b/sys/dev/sound/pci/cs4281.c
@@ -244,7 +244,7 @@ cs4281_format_to_bps(u_int32_t format)
 /* -------------------------------------------------------------------- */
 /* ac97 codec */
 
-static u_int32_t
+static int
 cs4281_rdcd(kobj_t obj, void *devinfo, int regno)
 {
     struct sc_info *sc = (struct sc_info *)devinfo;
@@ -278,7 +278,7 @@ cs4281_rdcd(kobj_t obj, void *devinfo, int regno)
     return cs4281_rd(sc, CS4281PCI_ACSDA);
 }
 
-static void
+static int
 cs4281_wrcd(kobj_t obj, void *devinfo, int regno, u_int32_t data)
 {
     struct sc_info *sc = (struct sc_info *)devinfo;
@@ -295,6 +295,8 @@ cs4281_wrcd(kobj_t obj, void *devinfo, int regno, u_int32_t data)
     if (cs4281_waitclr(sc, CS4281PCI_ACCTL, CS4281PCI_ACCTL_DCV, 250) == 0) {
 	device_printf(sc->dev,"cs4281_wrcd: DCV did not go\n");
     }
+
+    return (0);
 }
 
 static kobj_method_t cs4281_ac97_methods[] = {
@@ -334,7 +336,7 @@ cs4281chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channe
     return ch;
 }
 
-static int
+static u_int32_t
 cs4281chan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
     struct sc_chinfo *ch = data;
@@ -356,7 +358,7 @@ cs4281chan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
     return ch->blksz;
 }
 
-static int
+static u_int32_t
 cs4281chan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
     struct sc_chinfo *ch = data;
@@ -399,7 +401,7 @@ cs4281chan_setformat(kobj_t obj, void *data, u_int32_t format)
     return 0;
 }
 
-static int
+static u_int32_t
 cs4281chan_getptr(kobj_t obj, void *data)
 {
     struct sc_chinfo *ch = data;
diff --git a/sys/dev/sound/pci/csapcm.c b/sys/dev/sound/pci/csapcm.c
index c932c1d..df5f2d0 100644
--- a/sys/dev/sound/pci/csapcm.c
+++ b/sys/dev/sound/pci/csapcm.c
@@ -548,7 +548,7 @@ csachan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 csachan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct csa_chinfo *ch = data;
@@ -557,7 +557,7 @@ csachan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return ch->spd; /* XXX calc real speed */
 }
 
-static int
+static u_int32_t
 csachan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	return CS461x_BUFFSIZE / 2;
@@ -589,7 +589,7 @@ csachan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 csachan_getptr(kobj_t obj, void *data)
 {
 	struct csa_chinfo *ch = data;
diff --git a/sys/dev/sound/pci/ds1.c b/sys/dev/sound/pci/ds1.c
index 9ad24fd..b4c95fc 100644
--- a/sys/dev/sound/pci/ds1.c
+++ b/sys/dev/sound/pci/ds1.c
@@ -512,7 +512,7 @@ ds1pchan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 ds1pchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct sc_pchinfo *ch = data;
@@ -522,7 +522,7 @@ ds1pchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return speed;
 }
 
-static int
+static u_int32_t
 ds1pchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct sc_pchinfo *ch = data;
@@ -566,7 +566,7 @@ ds1pchan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 ds1pchan_getptr(kobj_t obj, void *data)
 {
 	struct sc_pchinfo *ch = data;
@@ -640,7 +640,7 @@ ds1rchan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 ds1rchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct sc_rchinfo *ch = data;
@@ -650,7 +650,7 @@ ds1rchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return speed;
 }
 
-static int
+static u_int32_t
 ds1rchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct sc_rchinfo *ch = data;
@@ -696,7 +696,7 @@ ds1rchan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 ds1rchan_getptr(kobj_t obj, void *data)
 {
 	struct sc_rchinfo *ch = data;
diff --git a/sys/dev/sound/pci/emu10k1.c b/sys/dev/sound/pci/emu10k1.c
index 43cc412..e1165c7 100644
--- a/sys/dev/sound/pci/emu10k1.c
+++ b/sys/dev/sound/pci/emu10k1.c
@@ -764,7 +764,7 @@ emupchan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 emupchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct sc_pchinfo *ch = data;
@@ -773,7 +773,7 @@ emupchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return ch->spd;
 }
 
-static int
+static u_int32_t
 emupchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct sc_pchinfo *ch = data;
@@ -819,7 +819,7 @@ emupchan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 emupchan_getptr(kobj_t obj, void *data)
 {
 	struct sc_pchinfo *ch = data;
@@ -915,7 +915,7 @@ emurchan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 emurchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct sc_rchinfo *ch = data;
@@ -934,7 +934,7 @@ emurchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return ch->spd;
 }
 
-static int
+static u_int32_t
 emurchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct sc_rchinfo *ch = data;
@@ -1033,7 +1033,7 @@ emurchan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 emurchan_getptr(kobj_t obj, void *data)
 {
 	struct sc_rchinfo *ch = data;
@@ -1068,8 +1068,9 @@ static kobj_method_t emurchan_methods[] = {
 CHANNEL_DECLARE(emurchan);
 
 static unsigned char
-emu_mread(void *arg, struct sc_info *sc, int reg)
-{	
+emu_mread(struct mpu401 *arg, void *cookie, int reg)
+{
+	struct sc_info *sc = cookie;
 	unsigned int d;
 
 	d = emu_rd(sc, 0x18 + reg, 1); 
@@ -1077,15 +1078,17 @@ emu_mread(void *arg, struct sc_info *sc, int reg)
 }
 
 static void
-emu_mwrite(void *arg, struct sc_info *sc, int reg, unsigned char b)
+emu_mwrite(struct mpu401 *arg, void *cookie, int reg, unsigned char b)
 {
+	struct sc_info *sc = cookie;
 
 	emu_wr(sc, 0x18 + reg, b, 1);
 }
 
 static int
-emu_muninit(void *arg, struct sc_info *sc)
+emu_muninit(struct mpu401 *arg, void *cookie)
 {
+	struct sc_info *sc = cookie;
 
 	snd_mtxlock(sc->lock);
 	sc->mpu_intr = 0;
diff --git a/sys/dev/sound/pci/emu10kx-midi.c b/sys/dev/sound/pci/emu10kx-midi.c
index 736e7c2..8049c5a 100644
--- a/sys/dev/sound/pci/emu10kx-midi.c
+++ b/sys/dev/sound/pci/emu10kx-midi.c
@@ -65,8 +65,9 @@ static uint32_t	emu_midi_card_intr(void *p, uint32_t arg);
 static devclass_t emu_midi_devclass;
 
 static unsigned char
-emu_mread(void *arg __unused, struct emu_midi_softc *sc, int reg)
+emu_mread(struct mpu401 *arg __unused, void *cookie, int reg)
 {
+	struct emu_midi_softc *sc = cookie;
 	unsigned int d;
 
 	d = 0;
@@ -79,8 +80,9 @@ emu_mread(void *arg __unused, struct emu_midi_softc *sc, int reg)
 }
 
 static void
-emu_mwrite(void *arg __unused, struct emu_midi_softc *sc, int reg, unsigned char b)
+emu_mwrite(struct mpu401 *arg __unused, void *cookie, int reg, unsigned char b)
 {
+	struct emu_midi_softc *sc = cookie;
 
 	if (sc->is_emu10k1)
 		emu_wr(sc->card, 0x18 + reg, b, 1);
@@ -89,8 +91,9 @@ emu_mwrite(void *arg __unused, struct emu_midi_softc *sc, int reg, unsigned char
 }
 
 static int
-emu_muninit(void *arg __unused, struct emu_midi_softc *sc)
+emu_muninit(struct mpu401 *arg __unused, void *cookie)
 {
+	struct emu_midi_softc *sc = cookie;
 
 	mtx_lock(&sc->mtx);
 	sc->mpu_intr = NULL;
diff --git a/sys/dev/sound/pci/emu10kx-pcm.c b/sys/dev/sound/pci/emu10kx-pcm.c
index 99fefd7..2a305de 100644
--- a/sys/dev/sound/pci/emu10kx-pcm.c
+++ b/sys/dev/sound/pci/emu10kx-pcm.c
@@ -385,7 +385,7 @@ emu_dspmixer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned righ
 	return  (0);
 }
 
-static int
+static u_int32_t
 emu_dspmixer_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
 	struct emu_pcm_info *sc;
@@ -486,7 +486,7 @@ emu_efxmixer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned righ
 	return  (0);
 }
 
-static int
+static u_int32_t
 emu_efxmixer_setrecsrc(struct snd_mixer *m __unused, u_int32_t src __unused)
 {
 	return (SOUND_MASK_MONITOR);
@@ -753,7 +753,7 @@ emupchan_setformat(kobj_t obj __unused, void *c_devinfo, uint32_t format)
 	return (0);
 }
 
-static int
+static uint32_t
 emupchan_setspeed(kobj_t obj __unused, void *c_devinfo, uint32_t speed)
 {
 	struct emu_pcm_pchinfo *ch = c_devinfo;
@@ -762,7 +762,7 @@ emupchan_setspeed(kobj_t obj __unused, void *c_devinfo, uint32_t speed)
 	return (ch->spd);
 }
 
-static int
+static uint32_t
 emupchan_setblocksize(kobj_t obj __unused, void *c_devinfo, uint32_t blocksize)
 {
 	struct emu_pcm_pchinfo *ch = c_devinfo;
@@ -804,7 +804,7 @@ emupchan_trigger(kobj_t obj __unused, void *c_devinfo, int go)
 	return (0);
 }
 
-static int
+static uint32_t
 emupchan_getptr(kobj_t obj __unused, void *c_devinfo)
 {
 	struct emu_pcm_pchinfo *ch = c_devinfo;
@@ -902,7 +902,7 @@ emurchan_setformat(kobj_t obj __unused, void *c_devinfo, uint32_t format)
 	return (0);
 }
 
-static int
+static uint32_t
 emurchan_setspeed(kobj_t obj __unused, void *c_devinfo, uint32_t speed)
 {
 	struct emu_pcm_rchinfo *ch = c_devinfo;
@@ -916,7 +916,7 @@ emurchan_setspeed(kobj_t obj __unused, void *c_devinfo, uint32_t speed)
 	return (ch->spd);
 }
 
-static int
+static uint32_t
 emurchan_setblocksize(kobj_t obj __unused, void *c_devinfo, uint32_t blocksize)
 {
 	struct emu_pcm_rchinfo *ch = c_devinfo;
@@ -1001,7 +1001,7 @@ emurchan_trigger(kobj_t obj __unused, void *c_devinfo, int go)
 	return (0);
 }
 
-static int
+static uint32_t
 emurchan_getptr(kobj_t obj __unused, void *c_devinfo)
 {
 	struct emu_pcm_rchinfo *ch = c_devinfo;
@@ -1071,7 +1071,7 @@ emufxrchan_setformat(kobj_t obj __unused, void *c_devinfo __unused, uint32_t for
 	return (EINVAL);
 }
 
-static int
+static uint32_t
 emufxrchan_setspeed(kobj_t obj __unused, void *c_devinfo, uint32_t speed)
 {
 	struct emu_pcm_rchinfo *ch = c_devinfo;
@@ -1080,7 +1080,7 @@ emufxrchan_setspeed(kobj_t obj __unused, void *c_devinfo, uint32_t speed)
 	return (ch->spd);
 }
 
-static int
+static uint32_t
 emufxrchan_setblocksize(kobj_t obj __unused, void *c_devinfo, uint32_t blocksize)
 {
 	struct emu_pcm_rchinfo *ch = c_devinfo;
@@ -1171,7 +1171,7 @@ emufxrchan_trigger(kobj_t obj __unused, void *c_devinfo, int go)
 	return (0);
 }
 
-static int
+static uint32_t
 emufxrchan_getptr(kobj_t obj __unused, void *c_devinfo)
 {
 	struct emu_pcm_rchinfo *ch = c_devinfo;
diff --git a/sys/dev/sound/pci/envy24.c b/sys/dev/sound/pci/envy24.c
index 0fd57d8..14fa45f 100644
--- a/sys/dev/sound/pci/envy24.c
+++ b/sys/dev/sound/pci/envy24.c
@@ -187,10 +187,10 @@ static void envy24_r32sl(struct sc_chinfo *);
 /* channel interface */
 static void *envy24chan_init(kobj_t, void *, struct snd_dbuf *, struct pcm_channel *, int);
 static int envy24chan_setformat(kobj_t, void *, u_int32_t);
-static int envy24chan_setspeed(kobj_t, void *, u_int32_t);
-static int envy24chan_setblocksize(kobj_t, void *, u_int32_t);
+static u_int32_t envy24chan_setspeed(kobj_t, void *, u_int32_t);
+static u_int32_t envy24chan_setblocksize(kobj_t, void *, u_int32_t);
 static int envy24chan_trigger(kobj_t, void *, int);
-static int envy24chan_getptr(kobj_t, void *);
+static u_int32_t envy24chan_getptr(kobj_t, void *);
 static struct pcmchan_caps *envy24chan_getcaps(kobj_t, void *);
 
 /* mixer interface */
@@ -1087,7 +1087,7 @@ static struct {
 	{0, 0x10}
 };
 
-static int
+static u_int32_t
 envy24_setspeed(struct sc_info *sc, u_int32_t speed) {
 	u_int32_t code;
 	int i = 0;
@@ -1691,7 +1691,7 @@ envy24chan_setformat(kobj_t obj, void *data, u_int32_t format)
   start triggerd, some other channel is running, and that channel's
   speed isn't same with, then trigger function will fail.
 */
-static int
+static u_int32_t
 envy24chan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct sc_chinfo *ch = data;
@@ -1716,7 +1716,7 @@ envy24chan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return ch->speed;
 }
 
-static int
+static u_int32_t
 envy24chan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct sc_chinfo *ch = data;
@@ -1864,7 +1864,7 @@ envy24chan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 envy24chan_getptr(kobj_t obj, void *data)
 {
 	struct sc_chinfo *ch = data;
diff --git a/sys/dev/sound/pci/envy24ht.c b/sys/dev/sound/pci/envy24ht.c
index a9d32e1..37d8bb5 100644
--- a/sys/dev/sound/pci/envy24ht.c
+++ b/sys/dev/sound/pci/envy24ht.c
@@ -186,10 +186,10 @@ static void envy24ht_r32sl(struct sc_chinfo *);
 /* channel interface */
 static void *envy24htchan_init(kobj_t, void *, struct snd_dbuf *, struct pcm_channel *, int);
 static int envy24htchan_setformat(kobj_t, void *, u_int32_t);
-static int envy24htchan_setspeed(kobj_t, void *, u_int32_t);
-static int envy24htchan_setblocksize(kobj_t, void *, u_int32_t);
+static u_int32_t envy24htchan_setspeed(kobj_t, void *, u_int32_t);
+static u_int32_t envy24htchan_setblocksize(kobj_t, void *, u_int32_t);
 static int envy24htchan_trigger(kobj_t, void *, int);
-static int envy24htchan_getptr(kobj_t, void *);
+static u_int32_t envy24htchan_getptr(kobj_t, void *);
 static struct pcmchan_caps *envy24htchan_getcaps(kobj_t, void *);
 
 /* mixer interface */
@@ -1037,7 +1037,7 @@ static struct {
 	{0, 0x10}
 };
 
-static int
+static u_int32_t
 envy24ht_setspeed(struct sc_info *sc, u_int32_t speed) {
 	u_int32_t code, i2sfmt;
 	int i = 0;
@@ -1602,7 +1602,7 @@ envy24htchan_setformat(kobj_t obj, void *data, u_int32_t format)
   start triggerd, some other channel is running, and that channel's
   speed isn't same with, then trigger function will fail.
 */
-static int
+static u_int32_t
 envy24htchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct sc_chinfo *ch = data;
@@ -1627,7 +1627,7 @@ envy24htchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return ch->speed;
 }
 
-static int
+static u_int32_t
 envy24htchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct sc_chinfo *ch = data;
@@ -1773,7 +1773,7 @@ envy24htchan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 envy24htchan_getptr(kobj_t obj, void *data)
 {
 	struct sc_chinfo *ch = data;
diff --git a/sys/dev/sound/pci/es137x.c b/sys/dev/sound/pci/es137x.c
index 984aac9..5971e53 100644
--- a/sys/dev/sound/pci/es137x.c
+++ b/sys/dev/sound/pci/es137x.c
@@ -349,7 +349,7 @@ es1370_mixset(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 	return (l | (r << 8));
 }
 
-static int
+static uint32_t
 es1370_mixsetrecsrc(struct snd_mixer *m, uint32_t src)
 {
 	struct es_info *es;
@@ -535,7 +535,7 @@ eschan_setformat(kobj_t obj, void *data, uint32_t format)
 	return (0);
 }
 
-static int
+static uint32_t
 eschan1370_setspeed(kobj_t obj, void *data, uint32_t speed)
 {
 	struct es_chinfo *ch = data;
@@ -580,7 +580,7 @@ eschan1370_setspeed(kobj_t obj, void *data, uint32_t speed)
 	return (speed);
 }
 
-static int
+static uint32_t
 eschan1371_setspeed(kobj_t obj, void *data, uint32_t speed)
 {
   	struct es_chinfo *ch = data;
@@ -639,7 +639,7 @@ eschan_setfragments(kobj_t obj, void *data, uint32_t blksz, uint32_t blkcnt)
 	return (1);
 }
 
-static int
+static uint32_t
 eschan_setblocksize(kobj_t obj, void *data, uint32_t blksz)
 {
   	struct es_chinfo *ch = data;
@@ -820,7 +820,7 @@ eschan_trigger(kobj_t obj, void *data, int go)
 	return (0);
 }
 
-static int
+static uint32_t
 eschan_getptr(kobj_t obj, void *data)
 {
 	struct es_chinfo *ch = data;
diff --git a/sys/dev/sound/pci/fm801.c b/sys/dev/sound/pci/fm801.c
index 8ee8f28..09738d2 100644
--- a/sys/dev/sound/pci/fm801.c
+++ b/sys/dev/sound/pci/fm801.c
@@ -384,7 +384,7 @@ struct {
 /* anything above -> 48000 */
 };
 
-static int
+static u_int32_t
 fm801ch_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct fm801_chinfo *ch = data;
@@ -411,7 +411,7 @@ fm801ch_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return fm801_rates[i].rate;
 }
 
-static int
+static u_int32_t
 fm801ch_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct fm801_chinfo *ch = data;
@@ -489,7 +489,7 @@ fm801ch_trigger(kobj_t obj, void *data, int go)
 }
 
 /* Almost ALSA copy */
-static int
+static u_int32_t
 fm801ch_getptr(kobj_t obj, void *data)
 {
 	struct fm801_chinfo *ch = data;
diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c
index e580944..86f6324 100644
--- a/sys/dev/sound/pci/hda/hdac.c
+++ b/sys/dev/sound/pci/hda/hdac.c
@@ -3370,7 +3370,7 @@ hdac_channel_setformat(kobj_t obj, void *data, uint32_t format)
 	return (EINVAL);
 }
 
-static int
+static uint32_t
 hdac_channel_setspeed(kobj_t obj, void *data, uint32_t speed)
 {
 	struct hdac_chan *ch = data;
@@ -3518,7 +3518,7 @@ hdac_channel_setfragments(kobj_t obj, void *data,
 	return (1);
 }
 
-static int
+static uint32_t
 hdac_channel_setblocksize(kobj_t obj, void *data, uint32_t blksz)
 {
 	struct hdac_chan *ch = data;
@@ -3592,7 +3592,7 @@ hdac_channel_trigger(kobj_t obj, void *data, int go)
 	return (0);
 }
 
-static int
+static uint32_t
 hdac_channel_getptr(kobj_t obj, void *data)
 {
 	struct hdac_chan *ch = data;
diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c
index 7351355..a33c986 100644
--- a/sys/dev/sound/pci/ich.c
+++ b/sys/dev/sound/pci/ich.c
@@ -269,7 +269,7 @@ ich_rdcd(kobj_t obj, void *devinfo, int regno)
 }
 
 static int
-ich_wrcd(kobj_t obj, void *devinfo, int regno, uint16_t data)
+ich_wrcd(kobj_t obj, void *devinfo, int regno, uint32_t data)
 {
 	struct sc_info *sc = (struct sc_info *)devinfo;
 
@@ -439,7 +439,7 @@ ichchan_setformat(kobj_t obj, void *data, uint32_t format)
 	return (0);
 }
 
-static int
+static uint32_t
 ichchan_setspeed(kobj_t obj, void *data, uint32_t speed)
 {
 	struct sc_chinfo *ch = data;
@@ -473,7 +473,7 @@ ichchan_setspeed(kobj_t obj, void *data, uint32_t speed)
 	return (ch->spd);
 }
 
-static int
+static uint32_t
 ichchan_setblocksize(kobj_t obj, void *data, uint32_t blocksize)
 {
 	struct sc_chinfo *ch = data;
@@ -535,7 +535,7 @@ ichchan_trigger(kobj_t obj, void *data, int go)
 	return (0);
 }
 
-static int
+static uint32_t
 ichchan_getptr(kobj_t obj, void *data)
 {
 	struct sc_chinfo *ch = data;
diff --git a/sys/dev/sound/pci/maestro.c b/sys/dev/sound/pci/maestro.c
index cec690a..2143051 100644
--- a/sys/dev/sound/pci/maestro.c
+++ b/sys/dev/sound/pci/maestro.c
@@ -1381,13 +1381,13 @@ aggpch_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 aggpch_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	return ((struct agg_chinfo*)data)->speed = speed;
 }
 
-static int
+static u_int32_t
 aggpch_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct agg_chinfo *ch = data;
@@ -1430,7 +1430,7 @@ aggpch_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 aggpch_getptr(kobj_t obj, void *data)
 {
 	struct agg_chinfo *ch = data;
@@ -1526,13 +1526,13 @@ aggrch_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 aggrch_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	return ((struct agg_rchinfo*)data)->speed = speed;
 }
 
-static int
+static u_int32_t
 aggrch_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct agg_rchinfo *ch = data;
@@ -1579,7 +1579,7 @@ aggrch_trigger(kobj_t obj, void *sc, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 aggrch_getptr(kobj_t obj, void *sc)
 {
 	struct agg_rchinfo *ch = sc;
diff --git a/sys/dev/sound/pci/maestro3.c b/sys/dev/sound/pci/maestro3.c
index 8f1084c..10ebda0 100644
--- a/sys/dev/sound/pci/maestro3.c
+++ b/sys/dev/sound/pci/maestro3.c
@@ -162,8 +162,8 @@ struct sc_info {
 static void *m3_pchan_init(kobj_t, void *, struct snd_dbuf *, struct pcm_channel *, int);
 static int m3_pchan_free(kobj_t, void *);
 static int m3_pchan_setformat(kobj_t, void *, u_int32_t);
-static int m3_pchan_setspeed(kobj_t, void *, u_int32_t);
-static int m3_pchan_setblocksize(kobj_t, void *, u_int32_t);
+static u_int32_t m3_pchan_setspeed(kobj_t, void *, u_int32_t);
+static u_int32_t m3_pchan_setblocksize(kobj_t, void *, u_int32_t);
 static int m3_pchan_trigger(kobj_t, void *, int);
 static int m3_pchan_trigger_locked(kobj_t, void *, int);
 static u_int32_t m3_pchan_getptr_internal(struct sc_pchinfo *);
@@ -174,8 +174,8 @@ static struct pcmchan_caps *m3_pchan_getcaps(kobj_t, void *);
 static void *m3_rchan_init(kobj_t, void *, struct snd_dbuf *, struct pcm_channel *, int);
 static int m3_rchan_free(kobj_t, void *);
 static int m3_rchan_setformat(kobj_t, void *, u_int32_t);
-static int m3_rchan_setspeed(kobj_t, void *, u_int32_t);
-static int m3_rchan_setblocksize(kobj_t, void *, u_int32_t);
+static u_int32_t m3_rchan_setspeed(kobj_t, void *, u_int32_t);
+static u_int32_t m3_rchan_setblocksize(kobj_t, void *, u_int32_t);
 static int m3_rchan_trigger(kobj_t, void *, int);
 static int m3_rchan_trigger_locked(kobj_t, void *, int);
 static u_int32_t m3_rchan_getptr_internal(struct sc_rchinfo *);
@@ -185,7 +185,7 @@ static struct pcmchan_caps *m3_rchan_getcaps(kobj_t, void *);
 static int m3_chan_active(struct sc_info *);
 
 /* talk to the codec - called from ac97.c */
-static int	 m3_initcd(kobj_t, void *);
+static u_int32_t	 m3_initcd(kobj_t, void *);
 static int	 m3_rdcd(kobj_t, void *, int);
 static int  	 m3_wrcd(kobj_t, void *, int, u_int32_t);
 
@@ -309,7 +309,7 @@ m3_wait(struct sc_info *sc)
 /* -------------------------------------------------------------------- */
 /* ac97 codec */
 
-static int
+static u_int32_t
 m3_initcd(kobj_t kobj, void *devinfo)
 {
 	struct sc_info *sc = (struct sc_info *)devinfo;
@@ -532,7 +532,7 @@ m3_pchan_setformat(kobj_t kobj, void *chdata, u_int32_t format)
         return (0);
 }
 
-static int
+static u_int32_t
 m3_pchan_setspeed(kobj_t kobj, void *chdata, u_int32_t speed)
 {
 	struct sc_pchinfo *ch = chdata;
@@ -555,7 +555,7 @@ m3_pchan_setspeed(kobj_t kobj, void *chdata, u_int32_t speed)
 	return (speed);
 }
 
-static int
+static u_int32_t
 m3_pchan_setblocksize(kobj_t kobj, void *chdata, u_int32_t blocksize)
 {
 	struct sc_pchinfo *ch = chdata;
@@ -878,7 +878,7 @@ m3_rchan_setformat(kobj_t kobj, void *chdata, u_int32_t format)
         return (0);
 }
 
-static int
+static u_int32_t
 m3_rchan_setspeed(kobj_t kobj, void *chdata, u_int32_t speed)
 {
 	struct sc_rchinfo *ch = chdata;
@@ -901,7 +901,7 @@ m3_rchan_setspeed(kobj_t kobj, void *chdata, u_int32_t speed)
 	return (speed);
 }
 
-static int
+static u_int32_t
 m3_rchan_setblocksize(kobj_t kobj, void *chdata, u_int32_t blocksize)
 {
 	struct sc_rchinfo *ch = chdata;
diff --git a/sys/dev/sound/pci/neomagic.c b/sys/dev/sound/pci/neomagic.c
index 4b011bb..e391db5 100644
--- a/sys/dev/sound/pci/neomagic.c
+++ b/sys/dev/sound/pci/neomagic.c
@@ -380,7 +380,7 @@ nmchan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return nm_setch(ch);
 }
 
-static int
+static u_int32_t
 nmchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct sc_chinfo *ch = data;
@@ -389,7 +389,7 @@ nmchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return nm_setch(ch)? 0 : ch->spd;
 }
 
-static int
+static u_int32_t
 nmchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct sc_chinfo *ch = data;
@@ -447,7 +447,7 @@ nmchan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 nmchan_getptr(kobj_t obj, void *data)
 {
 	struct sc_chinfo *ch = data;
diff --git a/sys/dev/sound/pci/solo.c b/sys/dev/sound/pci/solo.c
index 5cf776d..1c3f6dc 100644
--- a/sys/dev/sound/pci/solo.c
+++ b/sys/dev/sound/pci/solo.c
@@ -556,7 +556,7 @@ esschan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 esschan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct ess_chinfo *ch = data;
@@ -570,7 +570,7 @@ esschan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return ch->spd;
 }
 
-static int
+static u_int32_t
 esschan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct ess_chinfo *ch = data;
@@ -608,7 +608,7 @@ esschan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 esschan_getptr(kobj_t obj, void *data)
 {
 	struct ess_chinfo *ch = data;
@@ -720,7 +720,7 @@ essmix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
     	return left | (right << 8);
 }
 
-static int
+static u_int32_t
 essmix_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
     	struct ess_info *sc = mix_getdevinfo(m);
diff --git a/sys/dev/sound/pci/t4dwave.c b/sys/dev/sound/pci/t4dwave.c
index 39ce02e..44c7242 100644
--- a/sys/dev/sound/pci/t4dwave.c
+++ b/sys/dev/sound/pci/t4dwave.c
@@ -510,7 +510,7 @@ trpchan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 trpchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct tr_chinfo *ch = data;
@@ -519,7 +519,7 @@ trpchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return (ch->delta * 48000) >> 12;
 }
 
-static int
+static u_int32_t
 trpchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct tr_chinfo *ch = data;
@@ -561,7 +561,7 @@ trpchan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 trpchan_getptr(kobj_t obj, void *data)
 {
 	struct tr_chinfo *ch = data;
@@ -627,7 +627,7 @@ trrchan_setformat(kobj_t obj, void *data, u_int32_t format)
 
 }
 
-static int
+static u_int32_t
 trrchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct tr_rchinfo *ch = data;
@@ -641,7 +641,7 @@ trrchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 	return (48000 << 12) / ch->delta;
 }
 
-static int
+static u_int32_t
 trrchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct tr_rchinfo *ch = data;
@@ -683,7 +683,7 @@ trrchan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 trrchan_getptr(kobj_t obj, void *data)
 {
  	struct tr_rchinfo *ch = data;
diff --git a/sys/dev/sound/pci/via8233.c b/sys/dev/sound/pci/via8233.c
index 68de81b..0f03f41 100644
--- a/sys/dev/sound/pci/via8233.c
+++ b/sys/dev/sound/pci/via8233.c
@@ -469,7 +469,7 @@ via8233msgd_setformat(kobj_t obj, void *data, uint32_t format)
 /* -------------------------------------------------------------------- */
 /* Speed setting functions */
 
-static int
+static uint32_t
 via8233wr_setspeed(kobj_t obj, void *data, uint32_t speed)
 {
 	struct via_chinfo *ch = data;
@@ -481,7 +481,7 @@ via8233wr_setspeed(kobj_t obj, void *data, uint32_t speed)
 	return (48000);
 }
 
-static int
+static uint32_t
 via8233dxs_setspeed(kobj_t obj, void *data, uint32_t speed)
 {
 	struct via_chinfo *ch = data;
@@ -501,7 +501,7 @@ via8233dxs_setspeed(kobj_t obj, void *data, uint32_t speed)
 	return (speed);
 }
 
-static int
+static uint32_t
 via8233msgd_setspeed(kobj_t obj, void *data, uint32_t speed)
 {
 	struct via_chinfo *ch = data;
@@ -599,7 +599,7 @@ via8233chan_setfragments(kobj_t obj, void *data,
 	return (1);
 }
 
-static int
+static uint32_t
 via8233chan_setblocksize(kobj_t obj, void *data, uint32_t blksz)
 {
 	struct via_chinfo *ch = data;
@@ -610,7 +610,7 @@ via8233chan_setblocksize(kobj_t obj, void *data, uint32_t blksz)
 	return (ch->blksz);
 }
 
-static int
+static uint32_t
 via8233chan_getptr(kobj_t obj, void *data)
 {
 	struct via_chinfo *ch = data;
diff --git a/sys/dev/sound/pci/via82c686.c b/sys/dev/sound/pci/via82c686.c
index e04e480..c904443 100644
--- a/sys/dev/sound/pci/via82c686.c
+++ b/sys/dev/sound/pci/via82c686.c
@@ -300,7 +300,7 @@ viachan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 viachan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct via_chinfo *ch = data;
@@ -323,7 +323,7 @@ viachan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 		return 48000;
 }
 
-static int
+static u_int32_t
 viachan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct via_chinfo *ch = data;
@@ -361,7 +361,7 @@ viachan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 viachan_getptr(kobj_t obj, void *data)
 {
 	struct via_chinfo *ch = data;
diff --git a/sys/dev/sound/pci/vibes.c b/sys/dev/sound/pci/vibes.c
index ee205fe..75aed41 100644
--- a/sys/dev/sound/pci/vibes.c
+++ b/sys/dev/sound/pci/vibes.c
@@ -210,7 +210,7 @@ svchan_getcaps(kobj_t obj, void *data)
         return &sc_caps;
 }
 
-static int
+static u_int32_t
 svchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	struct sc_chinfo *ch = data;
@@ -234,7 +234,7 @@ svchan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 svchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	struct sc_chinfo *ch = data;
@@ -347,7 +347,7 @@ svrchan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 svrchan_getptr(kobj_t obj, void *data)
 {
 	struct sc_chinfo	*ch = data;
@@ -424,7 +424,7 @@ svpchan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 svpchan_getptr(kobj_t obj, void *data)
 {
 	struct sc_chinfo	*ch = data;
@@ -536,7 +536,7 @@ sv_mix_set(struct snd_mixer *m, u_int32_t dev, u_int32_t left, u_int32_t right)
 	return sv_gain(sc, dev, left, right);
 }
 
-static int
+static u_int32_t
 sv_mix_setrecsrc(struct snd_mixer *m, u_int32_t mask)
 {
 	struct sc_info	*sc = mix_getdevinfo(m);
diff --git a/sys/dev/sound/pcm/ac97.c b/sys/dev/sound/pcm/ac97.c
index 22c14e8..9f1b1bc 100644
--- a/sys/dev/sound/pcm/ac97.c
+++ b/sys/dev/sound/pcm/ac97.c
@@ -1053,7 +1053,7 @@ ac97mix_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
 	return ac97_setmixer(codec, dev, left, right);
 }
 
-static int
+static u_int32_t
 ac97mix_setrecsrc(struct snd_mixer *m, u_int32_t src)
 {
 	int i;
diff --git a/sys/dev/sound/pcm/channel_if.m b/sys/dev/sound/pcm/channel_if.m
index 3429a33..2b37557 100644
--- a/sys/dev/sound/pcm/channel_if.m
+++ b/sys/dev/sound/pcm/channel_if.m
@@ -120,7 +120,7 @@ METHOD int setdir {
 	int dir;
 } DEFAULT channel_nosetdir;
 
-METHOD u_int32_t setformat {
+METHOD int setformat {
 	kobj_t obj;
 	void *data;
 	u_int32_t format;
diff --git a/sys/dev/sound/pcm/fake.c b/sys/dev/sound/pcm/fake.c
index 9cd17e1..991f8e5 100644
--- a/sys/dev/sound/pcm/fake.c
+++ b/sys/dev/sound/pcm/fake.c
@@ -88,13 +88,13 @@ fkchan_setformat(kobj_t obj, void *data, u_int32_t format)
 	return 0;
 }
 
-static int
+static u_int32_t
 fkchan_setspeed(kobj_t obj, void *data, u_int32_t speed)
 {
 	return speed;
 }
 
-static int
+static u_int32_t
 fkchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize)
 {
 	return blocksize;
@@ -106,7 +106,7 @@ fkchan_trigger(kobj_t obj, void *data, int go)
 	return 0;
 }
 
-static int
+static u_int32_t
 fkchan_getptr(kobj_t obj, void *data)
 {
 	return 0;
diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c
index d881654..ba02523 100644
--- a/sys/dev/sound/pcm/vchan.c
+++ b/sys/dev/sound/pcm/vchan.c
@@ -420,7 +420,7 @@ vchan_setformat(kobj_t obj, void *data, uint32_t format)
 	return (0);
 }
 
-static int
+static uint32_t
 vchan_setspeed(kobj_t obj, void *data, uint32_t speed)
 {
 	struct vchinfo *ch = data;
diff --git a/sys/dev/sound/usb/uaudio_pcm.c b/sys/dev/sound/usb/uaudio_pcm.c
index e227f1b..5a47c98 100644
--- a/sys/dev/sound/usb/uaudio_pcm.c
+++ b/sys/dev/sound/usb/uaudio_pcm.c
@@ -57,13 +57,13 @@ ua_chan_setformat(kobj_t obj, void *data, uint32_t format)
 	return (uaudio_chan_set_param_format(data, format));
 }
 
-static int
+static uint32_t
 ua_chan_setspeed(kobj_t obj, void *data, uint32_t speed)
 {
 	return (uaudio_chan_set_param_speed(data, speed));
 }
 
-static int
+static uint32_t
 ua_chan_setblocksize(kobj_t obj, void *data, uint32_t blocksize)
 {
 	return (uaudio_chan_set_param_blocksize(data, blocksize));
@@ -88,7 +88,7 @@ ua_chan_trigger(kobj_t obj, void *data, int go)
 	}
 }
 
-static int
+static uint32_t
 ua_chan_getptr(kobj_t obj, void *data)
 {
 	return (uaudio_chan_getptr(data));
@@ -141,7 +141,7 @@ ua_mixer_set(struct snd_mixer *m, unsigned type, unsigned left, unsigned right)
 	return (left | (right << 8));
 }
 
-static int
+static uint32_t
 ua_mixer_setrecsrc(struct snd_mixer *m, uint32_t src)
 {
 	struct mtx *mtx = mixer_get_lock(m);


More information about the freebsd-multimedia mailing list