'\" t .\" Title: device_attach .\" 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_ATTACH" "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_attach \- try to attach device to a driver\&. .SH "SYNOPSIS" .HP \w'int\ device_attach('u .BI "int device_attach(struct\ device\ *\ " "dev" ");" .SH "ARGUMENTS" .PP \fIdev\fR .RS 4 device\&. .RE .SH "DESCRIPTION" .PP Walk the list of drivers that the bus has and call \fBdriver_probe_device\fR for each pair\&. If a compatible pair is found, break out and return\&. .PP Returns 1 if the device was bound to a driver; 0 if no matching driver was found; \-ENODEV if the device is not registered\&. .PP When called for a USB interface, \fIdev\fR\->parent lock must be held\&. .SH "COPYRIGHT" .br