'\" t .\" Title: device_for_each_child .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Device drivers infrastructure .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "DEVICE_FOR_EACH_CHIL" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Device drivers infrastructure" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" device_for_each_child \- device child iterator\&. .SH "SYNOPSIS" .HP \w'int\ device_for_each_child('u .BI "int device_for_each_child(struct\ device\ *\ " "parent" ", void\ *\ " "data" ", int\ (*" "fn" ")\ (struct\ device\ *dev,\ void\ *data));" .SH "ARGUMENTS" .PP \fIparent\fR .RS 4 parent struct device\&. .RE .PP \fIdata\fR .RS 4 data for the callback\&. .RE .PP \fIfn\fR .RS 4 function to be called for each device\&. .RE .SH "DESCRIPTION" .PP Iterate over \fIparent\fR\*(Aqs child devices, and call \fIfn\fR for each, passing it \fIdata\fR\&. .PP We check the return of \fIfn\fR each time\&. If it returns anything other than 0, we break out and return that value\&. .SH "COPYRIGHT" .br