'\" t .\" Title: misc_register .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Miscellaneous Devices .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "MISC_REGISTER" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Miscellaneous Devices" .\" ----------------------------------------------------------------- .\" * 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" misc_register \- register a miscellaneous device .SH "SYNOPSIS" .HP \w'int\ misc_register('u .BI "int misc_register(struct\ miscdevice\ *\ " "misc" ");" .SH "ARGUMENTS" .PP \fImisc\fR .RS 4 device structure .RE .SH "DESCRIPTION" .PP Register a miscellaneous device with the kernel\&. If the minor number is set to \fBMISC_DYNAMIC_MINOR\fR a minor number is assigned and placed in the minor field of the structure\&. For other cases the minor number requested is used\&. .PP The structure passed is linked into the kernel and may not be destroyed until it has been unregistered\&. By default, an \fBopen\fR syscall to the device sets file\->private_data to point to the structure\&. Drivers don\*(Aqt need open in fops for this\&. .PP A zero is returned on success and a negative errno code for failure\&. .SH "COPYRIGHT" .br