aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/sound/pci')
-rw-r--r--sys/dev/sound/pci/hda/hdaa.c15
-rw-r--r--sys/dev/sound/pci/hda/hdac.c13
-rw-r--r--sys/dev/sound/pci/hda/hdacc.c13
3 files changed, 18 insertions, 23 deletions
diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c
index 8eeeadce6666..ae7d77d431b2 100644
--- a/sys/dev/sound/pci/hda/hdaa.c
+++ b/sys/dev/sound/pci/hda/hdaa.c
@@ -6738,23 +6738,21 @@ hdaa_print_child(device_t dev, device_t child)
}
static int
-hdaa_child_location_str(device_t dev, device_t child, char *buf,
- size_t buflen)
+hdaa_child_location(device_t dev, device_t child, struct sbuf *sb)
{
struct hdaa_devinfo *devinfo = device_get_softc(dev);
struct hdaa_pcm_devinfo *pdevinfo =
(struct hdaa_pcm_devinfo *)device_get_ivars(child);
struct hdaa_audio_as *as;
- int first = 1, i, len = 0;
+ int first = 1, i;
- len += snprintf(buf + len, buflen - len, "nid=");
+ sbuf_printf(sb, "nid=");
if (pdevinfo->playas >= 0) {
as = &devinfo->as[pdevinfo->playas];
for (i = 0; i < 16; i++) {
if (as->pins[i] <= 0)
continue;
- len += snprintf(buf + len, buflen - len,
- "%s%d", first ? "" : ",", as->pins[i]);
+ sbuf_printf(sb, "%s%d", first ? "" : ",", as->pins[i]);
first = 0;
}
}
@@ -6763,8 +6761,7 @@ hdaa_child_location_str(device_t dev, device_t child, char *buf,
for (i = 0; i < 16; i++) {
if (as->pins[i] <= 0)
continue;
- len += snprintf(buf + len, buflen - len,
- "%s%d", first ? "" : ",", as->pins[i]);
+ sbuf_printf(sb, "%s%d", first ? "" : ",", as->pins[i]);
first = 0;
}
}
@@ -6830,7 +6827,7 @@ static device_method_t hdaa_methods[] = {
DEVMETHOD(device_resume, hdaa_resume),
/* Bus interface */
DEVMETHOD(bus_print_child, hdaa_print_child),
- DEVMETHOD(bus_child_location_str, hdaa_child_location_str),
+ DEVMETHOD(bus_child_location, hdaa_child_location),
DEVMETHOD(hdac_stream_intr, hdaa_stream_intr),
DEVMETHOD(hdac_unsol_intr, hdaa_unsol_intr),
DEVMETHOD(hdac_pindump, hdaa_pindump),
diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c
index ec907715c5b1..b1fb193595fe 100644
--- a/sys/dev/sound/pci/hda/hdac.c
+++ b/sys/dev/sound/pci/hda/hdac.c
@@ -1774,21 +1774,20 @@ hdac_print_child(device_t dev, device_t child)
}
static int
-hdac_child_location_str(device_t dev, device_t child, char *buf, size_t buflen)
+hdac_child_location(device_t dev, device_t child, struct sbuf *sb)
{
- snprintf(buf, buflen, "cad=%d", (int)(intptr_t)device_get_ivars(child));
+ sbuf_printf(sb, "cad=%d", (int)(intptr_t)device_get_ivars(child));
return (0);
}
static int
-hdac_child_pnpinfo_str_method(device_t dev, device_t child, char *buf,
- size_t buflen)
+hdac_child_pnpinfo_method(device_t dev, device_t child, struct sbuf *sb)
{
struct hdac_softc *sc = device_get_softc(dev);
nid_t cad = (uintptr_t)device_get_ivars(child);
- snprintf(buf, buflen,
+ sbuf_printf(sb,
"vendor=0x%04x device=0x%04x revision=0x%02x stepping=0x%02x",
sc->codecs[cad].vendor_id, sc->codecs[cad].device_id,
sc->codecs[cad].revision_id, sc->codecs[cad].stepping_id);
@@ -2137,8 +2136,8 @@ static device_method_t hdac_methods[] = {
/* Bus interface */
DEVMETHOD(bus_get_dma_tag, hdac_get_dma_tag),
DEVMETHOD(bus_print_child, hdac_print_child),
- DEVMETHOD(bus_child_location_str, hdac_child_location_str),
- DEVMETHOD(bus_child_pnpinfo_str, hdac_child_pnpinfo_str_method),
+ DEVMETHOD(bus_child_location, hdac_child_location),
+ DEVMETHOD(bus_child_pnpinfo, hdac_child_pnpinfo_method),
DEVMETHOD(bus_read_ivar, hdac_read_ivar),
DEVMETHOD(hdac_get_mtx, hdac_get_mtx),
DEVMETHOD(hdac_codec_command, hdac_codec_command),
diff --git a/sys/dev/sound/pci/hda/hdacc.c b/sys/dev/sound/pci/hda/hdacc.c
index 3b1ca7ea61e5..ff72498ecb9f 100644
--- a/sys/dev/sound/pci/hda/hdacc.c
+++ b/sys/dev/sound/pci/hda/hdacc.c
@@ -542,21 +542,20 @@ hdacc_detach(device_t dev)
}
static int
-hdacc_child_location_str(device_t dev, device_t child, char *buf, size_t buflen)
+hdacc_child_location(device_t dev, device_t child, struct sbuf *sb)
{
struct hdacc_fg *fg = device_get_ivars(child);
- snprintf(buf, buflen, "nid=%d", fg->nid);
+ sbuf_printf(sb, "nid=%d", fg->nid);
return (0);
}
static int
-hdacc_child_pnpinfo_str_method(device_t dev, device_t child, char *buf,
- size_t buflen)
+hdacc_child_pnpinfo_method(device_t dev, device_t child, struct sbuf *sb)
{
struct hdacc_fg *fg = device_get_ivars(child);
- snprintf(buf, buflen, "type=0x%02x subsystem=0x%08x",
+ sbuf_printf(sb, "type=0x%02x subsystem=0x%08x",
fg->type, fg->subsystem_id);
return (0);
}
@@ -766,8 +765,8 @@ static device_method_t hdacc_methods[] = {
DEVMETHOD(device_suspend, hdacc_suspend),
DEVMETHOD(device_resume, hdacc_resume),
/* Bus interface */
- DEVMETHOD(bus_child_location_str, hdacc_child_location_str),
- DEVMETHOD(bus_child_pnpinfo_str, hdacc_child_pnpinfo_str_method),
+ DEVMETHOD(bus_child_location, hdacc_child_location),
+ DEVMETHOD(bus_child_pnpinfo, hdacc_child_pnpinfo_method),
DEVMETHOD(bus_print_child, hdacc_print_child),
DEVMETHOD(bus_probe_nomatch, hdacc_probe_nomatch),
DEVMETHOD(bus_read_ivar, hdacc_read_ivar),