aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/smbus
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2021-06-23 02:27:57 +0000
committerWarner Losh <imp@FreeBSD.org>2021-06-23 02:52:06 +0000
commitddfc9c4c59e2ea4871100d8c076adffe3af8ff21 (patch)
tree3a4cc2294b046b13050512960da01d0af6acc963 /sys/dev/smbus
parenta7f6c6fd94d658b9e3f6f9bec02edfefb1a3d652 (diff)
Diffstat (limited to 'sys/dev/smbus')
-rw-r--r--sys/dev/smbus/smbus.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/dev/smbus/smbus.c b/sys/dev/smbus/smbus.c
index d6b4d9ab78b6..3de5cbc2b1f8 100644
--- a/sys/dev/smbus/smbus.c
+++ b/sys/dev/smbus/smbus.c
@@ -32,11 +32,12 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/bus.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/mutex.h>
-#include <sys/bus.h>
+#include <sys/sbuf.h>
#include <dev/smbus/smbconf.h>
#include <dev/smbus/smbus.h>
@@ -135,16 +136,13 @@ smbus_hinted_child(device_t bus, const char *dname, int dunit)
}
static int
-smbus_child_location_str(device_t parent, device_t child, char *buf,
- size_t buflen)
+smbus_child_location(device_t parent, device_t child, struct sbuf *sb)
{
struct smbus_ivar *devi;
devi = device_get_ivars(child);
if (devi->addr != 0)
- snprintf(buf, buflen, "addr=0x%x", devi->addr);
- else if (buflen)
- buf[0] = 0;
+ sbuf_printf(sb, "addr=0x%x", devi->addr);
return (0);
}
@@ -228,7 +226,7 @@ static device_method_t smbus_methods[] = {
DEVMETHOD(bus_add_child, smbus_add_child),
DEVMETHOD(bus_hinted_child, smbus_hinted_child),
DEVMETHOD(bus_probe_nomatch, smbus_probe_nomatch),
- DEVMETHOD(bus_child_location_str, smbus_child_location_str),
+ DEVMETHOD(bus_child_location, smbus_child_location),
DEVMETHOD(bus_print_child, smbus_print_child),
DEVMETHOD(bus_read_ivar, smbus_read_ivar),
DEVMETHOD(bus_write_ivar, smbus_write_ivar),