'\" t .\" Title: driver_find_device .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: January 2017 .\" Manual: Device drivers infrastructure .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "DRIVER_FIND_DEVICE" "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" driver_find_device \- device iterator for locating a particular device\&. .SH "SYNOPSIS" .HP \w'struct\ device\ *\ driver_find_device('u .BI "struct device * driver_find_device(struct\ device_driver\ *\ " "drv" ", struct\ device\ *\ " "start" ", void\ *\ " "data" ", int\ (*" "match" ")\ (struct\ device\ *dev,\ void\ *data));" .SH "ARGUMENTS" .PP \fIdrv\fR .RS 4 The device\*(Aqs driver .RE .PP \fIstart\fR .RS 4 Device to begin with .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 \fBdriver_for_each_device\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, this function will return to the caller and not iterate over any more devices\&. .SH "COPYRIGHT" .br