From nobody Fri Nov 01 14:13:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg2rj1Zzzz5bpgS; Fri, 01 Nov 2024 14:13:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg2rh71k4z4bR6; Fri, 1 Nov 2024 14:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+lLUeDu36gNDclfET/xUyDdiQBz9bUxjG3TfCM4CmT8=; b=CxeikFdFGwWk6PNcgelfxo4+vETkLQ+7VAyx/ZpheyaPu3GC4JS/17HOzsDeKZHbAWLD1O RB0eNEZbiNuvv+HPiIdMmQuNfX8CFe7B7EOGm6Pu3SPtOtnbo9yjo2T6NAarLZkMH9aBhH n25M8GKCm1f1j76HFNqH6d6W4lIXgGHzaGkCaDyyMfMJCprkhZ7KkS5vn12L0vdQQ/AcnV QOjJ0hrHJKfisB5Y5BerX52jNvPYUDNUPM8paBR4qU6QmL4vQA8n/dmIyKaiLVsgiyu2vy tDEynfDbrFFrdmT0zKZhuFUsT06L73F6shjBUJP7MCGY3ZJi6IdojxrxhldOPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+lLUeDu36gNDclfET/xUyDdiQBz9bUxjG3TfCM4CmT8=; b=tODf5B2nELwepMEU8r3AYYMeRBRt6KKRphAIqM33WvUSTWdpX56QDauTfgEqq1sEHTFNKY TWE3IN5xl1n8/muM5kJawaknKVbt32w9vglkh0TPHgnQPY30oLQo8QVfVCMn8QAsb47vs8 oChkkmGemq3Q/XNtz4l5lVQ94iGs3kzwfvMilTJY0iBfi4+jwGXBgYEboD/Nnh7OKWVsE4 chiL/CsqO9yc80TfsbaGCEvRAYxcgKDFC80uB1WFjJJYJ0iAUWFC89uOj90M85fyBtjgBi SwoW+rpPAm39/A1KGvd5jr+umS70w3G+BLgT24UJcywpSqtvfGdgJcMepRJ5Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730470389; a=rsa-sha256; cv=none; b=o8UgwxD1dXichdkoOr9e9K1H1b5k2NO8kLNpzEnTgsRwcoK9Pe/QT0OCj/Ql32DZC5AOTC LXoLyiqtwH6vc2fx3Dyhc0MLLDrmc+ZZUYc4Vb8IRkn4524BK5/Lp+Jafw7xh1cuNsO4qR y1lMLYa78b/soUfx28nGETEeM0jC71eGTBW3y6sldwTEQbZCvXb/iYEHO85u/dfo05pheM pe7ISllg8HCz/WjFVVLthZY/0sZLPI1cOkADhbYYRd2iL6JOMeG9rvSNfGcp8aOB0a8uLt Mlf3rDxLEgCYQaFjL3hbBAkNpZSHGJOoFNtJgwHdqCVxlPYGBgK5GrGw0mfEYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg2rh6drqzP0v; Fri, 1 Nov 2024 14:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1ED807059683; Fri, 1 Nov 2024 14:13:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1ED86A059678; Fri, 1 Nov 2024 14:13:08 GMT (envelope-from git) Date: Fri, 1 Nov 2024 14:13:08 GMT Message-Id: <202411011413.4A1ED86A059678@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 9c99ba9a0677 - main - iicbus: Use a bus_child_deleted method to free ivars for children List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c99ba9a0677a7b5c3c578c430211dafb4ad0dd5 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9c99ba9a0677a7b5c3c578c430211dafb4ad0dd5 commit 9c99ba9a0677a7b5c3c578c430211dafb4ad0dd5 Author: John Baldwin AuthorDate: 2024-11-01 14:09:50 +0000 Commit: John Baldwin CommitDate: 2024-11-01 14:09:50 +0000 iicbus: Use a bus_child_deleted method to free ivars for children Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47370 --- sys/dev/iicbus/iicbus.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/dev/iicbus/iicbus.c b/sys/dev/iicbus/iicbus.c index 33fb5c875c50..f48338865e0a 100644 --- a/sys/dev/iicbus/iicbus.c +++ b/sys/dev/iicbus/iicbus.c @@ -248,6 +248,18 @@ iicbus_add_child(device_t dev, u_int order, const char *name, int unit) dev, order, name, unit, sizeof(struct iicbus_ivar))); } +static void +iicbus_child_deleted(device_t dev, device_t child) +{ + struct iicbus_ivar *devi; + + devi = device_get_ivars(child); + if (devi == NULL) + return; + resource_list_free(&devi->rl); + free(devi, M_DEVBUF); +} + static void iicbus_hinted_child(device_t bus, const char *dname, int dunit) { @@ -360,6 +372,7 @@ static device_method_t iicbus_methods[] = { DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_get_resource_list, iicbus_get_resource_list), DEVMETHOD(bus_add_child, iicbus_add_child), + DEVMETHOD(bus_child_deleted, iicbus_child_deleted), DEVMETHOD(bus_print_child, iicbus_print_child), DEVMETHOD(bus_probe_nomatch, iicbus_probe_nomatch), DEVMETHOD(bus_read_ivar, iicbus_read_ivar),