summaryrefslogtreecommitdiff
path: root/sys/dev/smbus
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2024-11-01 14:10:10 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2024-12-01 02:46:07 +0000
commit87bb96bb4788cc33c1a9b19671bdd0884acc5152 (patch)
tree74639b8cfa7b473850d7988511c8bef2aecef1cf /sys/dev/smbus
parent69cfc0c25d131fc46617951a23f794032dd365d3 (diff)
Diffstat (limited to 'sys/dev/smbus')
-rw-r--r--sys/dev/smbus/smbus.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/smbus/smbus.c b/sys/dev/smbus/smbus.c
index 074530081049..3d0f5fe65464 100644
--- a/sys/dev/smbus/smbus.c
+++ b/sys/dev/smbus/smbus.c
@@ -114,6 +114,12 @@ smbus_add_child(device_t dev, u_int order, const char *name, int unit)
}
static void
+smbus_child_deleted(device_t dev, device_t child)
+{
+ free(device_get_ivars(child), M_DEVBUF);
+}
+
+static void
smbus_hinted_child(device_t bus, const char *dname, int dunit)
{
struct smbus_ivar *devi;
@@ -223,6 +229,7 @@ static device_method_t smbus_methods[] = {
/* bus interface */
DEVMETHOD(bus_add_child, smbus_add_child),
+ DEVMETHOD(bus_child_deleted, smbus_child_deleted),
DEVMETHOD(bus_hinted_child, smbus_hinted_child),
DEVMETHOD(bus_probe_nomatch, smbus_probe_nomatch),
DEVMETHOD(bus_child_location, smbus_child_location),