Skip to content

Commit 3f93f96

Browse files
committed
device_delete_child.9: Reference device_detach.9 and BUS_CHILD_DELETED.9
Refer to device_detach(9) for the description of detaching a device. Note that descendants of the child device are also deleted (though in theory a proper detach routine should have already deleted these). Finally, note that BUS_CHILD_DELETED(9) is invoked on each deleted device. Differential Revision: https://reviews.freebsd.org/D48365
1 parent d7fa71d commit 3f93f96

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

share/man/man9/device_delete_child.9

+18-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2727
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
.\"
29-
.Dd June 16, 1998
29+
.Dd February 5, 2025
3030
.Dt DEVICE_DELETE_CHILD 9
3131
.Os
3232
.Sh NAME
@@ -41,13 +41,26 @@
4141
The specified device is removed from
4242
.Fa dev
4343
and deleted.
44-
If the device is currently attached, it is first detached (see
45-
.Xr DEVICE_ATTACH 9
46-
and
47-
.Xr DEVICE_DETACH 9 ) .
44+
If the device is currently attached, it is first detached via
45+
.Xr device_detach 9 .
46+
If
47+
.Fn device_detach
48+
fails,
49+
its error value is returned.
50+
Otherwise,
51+
all descendant devices of
52+
.Fa child
53+
are deleted and zero is returned.
54+
.Pp
55+
The
56+
.Xr BUS_CHILD_DELETED 9
57+
method is invoked for each device that is deleted.
58+
This permits the parent device's driver to tear down any state associated
59+
with child devices such as ivars.
4860
.Sh RETURN VALUES
4961
Zero is returned on success, otherwise an error is returned.
5062
.Sh SEE ALSO
63+
.Xr BUS_CHILD_DELETED 9 ,
5164
.Xr device_add_child 9
5265
.Sh AUTHORS
5366
This manual page was written by

0 commit comments

Comments
 (0)