'\" t .\" Title: devres_get .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Driver Basics .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "DEVRES_GET" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Driver Basics" .\" ----------------------------------------------------------------- .\" * 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" devres_get \- Find devres, if non\-existent, add one atomically .SH "SYNOPSIS" .HP \w'void\ *\ devres_get('u .BI "void * devres_get(struct\ device\ *\ " "dev" ", void\ *\ " "new_res" ", dr_match_t\ " "match" ", void\ *\ " "match_data" ");" .SH "ARGUMENTS" .PP \fIdev\fR .RS 4 Device to lookup or add devres for .RE .PP \fInew_res\fR .RS 4 Pointer to new initialized devres to add if not found .RE .PP \fImatch\fR .RS 4 Match function (optional) .RE .PP \fImatch_data\fR .RS 4 Data for the match function .RE .SH "DESCRIPTION" .PP Find the latest devres of \fIdev\fR which has the same release function as \fInew_res\fR and for which \fImatch\fR return 1\&. If found, \fInew_res\fR is freed; otherwise, \fInew_res\fR is added atomically\&. .SH "RETURN" .PP Pointer to found or added devres\&. .SH "COPYRIGHT" .br