'\" t .\" Title: device_initialize .\" 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_INITIALIZE" "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_initialize \- init device structure\&. .SH "SYNOPSIS" .HP \w'void\ device_initialize('u .BI "void device_initialize(struct\ device\ *\ " "dev" ");" .SH "ARGUMENTS" .PP \fIdev\fR .RS 4 device\&. .RE .SH "DESCRIPTION" .PP This prepares the device for use by other layers by initializing its fields\&. It is the first half of \fBdevice_register\fR, if called by that function, though it can also be called separately, so one may use \fIdev\fR\*(Aqs fields\&. In particular, \fBget_device\fR/\fBput_device\fR may be used for reference counting of \fIdev\fR after calling this function\&. .PP All fields in \fIdev\fR must be initialized by the caller to 0, except for those explicitly set to some other value\&. The simplest approach is to use \fBkzalloc\fR to allocate the structure containing \fIdev\fR\&. .SH "NOTE" .PP Use \fBput_device\fR to give up your reference instead of freeing \fIdev\fR directly once you have called this function\&. .SH "COPYRIGHT" .br