aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Margiolis <christos@FreeBSD.org>2025-11-11 12:05:03 +0000
committerChristos Margiolis <christos@FreeBSD.org>2025-11-11 12:05:03 +0000
commit55540ebc33ad9a52bc4de121cb598243153981a8 (patch)
tree15cf38bceb79759137d6be525bfce86b665280d5
parent3ba4e3d352e5fbc550645a76064ca16460616d86 (diff)
sound: Retire snd_dbuf->dev
Redundant, and if we at some point really need this, we can fetch it from snd_dbuf->channel->dev. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D53519
-rw-r--r--sys/dev/sound/pcm/buffer.c5
-rw-r--r--sys/dev/sound/pcm/buffer.h3
-rw-r--r--sys/dev/sound/pcm/channel.c4
3 files changed, 5 insertions, 7 deletions
diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c
index de535ec2dcba..0b77ab599aed 100644
--- a/sys/dev/sound/pcm/buffer.c
+++ b/sys/dev/sound/pcm/buffer.c
@@ -41,13 +41,12 @@
#include "snd_fxdiv_gen.h"
struct snd_dbuf *
-sndbuf_create(device_t dev, char *drv, char *desc, struct pcm_channel *channel)
+sndbuf_create(char *drv, char *desc, struct pcm_channel *channel)
{
struct snd_dbuf *b;
b = malloc(sizeof(*b), M_DEVBUF, M_WAITOK | M_ZERO);
snprintf(b->name, SNDBUF_NAMELEN, "%s:%s", drv, desc);
- b->dev = dev;
b->channel = channel;
return b;
@@ -72,7 +71,7 @@ sndbuf_setmap(void *arg, bus_dma_segment_t *segs, int nseg, int error)
struct snd_dbuf *b = (struct snd_dbuf *)arg;
if (snd_verbose > 3) {
- device_printf(b->dev, "sndbuf_setmap %lx, %lx; ",
+ printf("sndbuf_setmap %lx, %lx; ",
(u_long)segs[0].ds_addr, (u_long)segs[0].ds_len);
printf("%p -> %lx\n", b->buf, (u_long)segs[0].ds_addr);
}
diff --git a/sys/dev/sound/pcm/buffer.h b/sys/dev/sound/pcm/buffer.h
index 841bfb85af3c..eaca6d8f313d 100644
--- a/sys/dev/sound/pcm/buffer.h
+++ b/sys/dev/sound/pcm/buffer.h
@@ -31,7 +31,6 @@
#define SNDBUF_NAMELEN 48
struct snd_dbuf {
- device_t dev;
u_int8_t *buf, *tmpbuf;
u_int8_t *shadbuf; /**< shadow buffer used w/ S_D_SILENCE/SKIP */
volatile int sl; /**< shadbuf ready length in # of bytes */
@@ -55,7 +54,7 @@ struct snd_dbuf {
char name[SNDBUF_NAMELEN];
};
-struct snd_dbuf *sndbuf_create(device_t dev, char *drv, char *desc, struct pcm_channel *channel);
+struct snd_dbuf *sndbuf_create(char *drv, char *desc, struct pcm_channel *channel);
void sndbuf_destroy(struct snd_dbuf *b);
void sndbuf_dump(struct snd_dbuf *b, char *s, u_int32_t what);
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 062eeb251a5b..e7c0779ea2df 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -1269,8 +1269,8 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls,
goto fail;
}
- b = sndbuf_create(c->dev, c->name, "primary", c);
- bs = sndbuf_create(c->dev, c->name, "secondary", c);
+ b = sndbuf_create(c->name, "primary", c);
+ bs = sndbuf_create(c->name, "secondary", c);
if (b == NULL || bs == NULL) {
device_printf(d->dev, "%s(): failed to create %s buffer\n",
__func__, b == NULL ? "hardware" : "software");