'\" t .\" Title: device_find_child .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: May 2018 .\" Manual: Device drivers infrastructure .\" Source: Kernel Hackers Manual 3.16.56 .\" Language: English .\" .TH "DEVICE_FIND_CHILD" "9" "May 2018" "Kernel Hackers Manual 3\&.16\&" "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_find_child \- device iterator for locating a particular device\&. .SH "SYNOPSIS" .HP \w'struct\ device\ *\ device_find_child('u .BI "struct device * device_find_child(struct\ device\ *\ " "parent" ", void\ *\ " "data" ", int\ (*" "match" ")\ (struct\ device\ *dev,\ void\ *data));" .SH "ARGUMENTS" .PP \fIparent\fR .RS 4 parent struct device .RE .PP \fIdata\fR .RS 4 Data to pass to match function .RE .PP \fImatch\fR .RS 4 Callback function to check device .RE .SH "DESCRIPTION" .PP This is similar to the \fBdevice_for_each_child\fR function above, but it returns a reference to a device that is \*(Aqfound\*(Aq for later use, as determined by the \fImatch\fR callback\&. .PP The callback should return 0 if the device doesn\*(Aqt match and non\-zero if it does\&. If the callback returns non\-zero and a reference to the current device can be obtained, this function will return to the caller and not iterate over any more devices\&. .SH "NOTE" .PP you will need to drop the reference with \fBput_device\fR after use\&. .SH "COPYRIGHT" .br