'\" t .\" Title: __parport_register_driver .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Parallel Port Devices .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "__PARPORT_REGISTER_D" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Parallel Port 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" __parport_register_driver \- register a parallel port device driver .SH "SYNOPSIS" .HP \w'int\ __parport_register_driver('u .BI "int __parport_register_driver(struct\ parport_driver\ *\ " "drv" ", struct\ module\ *\ " "owner" ", const\ char\ *\ " "mod_name" ");" .SH "ARGUMENTS" .PP \fIdrv\fR .RS 4 structure describing the driver .RE .PP \fIowner\fR .RS 4 owner module of drv .RE .PP \fImod_name\fR .RS 4 module name string .RE .SH "DESCRIPTION" .PP This can be called by a parallel port device driver in order to receive notifications about ports being found in the system, as well as ports no longer available\&. .PP If devmodel is true then the new device model is used for registration\&. .PP The \fIdrv\fR structure is allocated by the caller and must not be deallocated until after calling \fBparport_unregister_driver\fR\&. .PP If using the non device model: The driver\*(Aqs \fBattach\fR function may block\&. The port that \fBattach\fR is given will be valid for the duration of the callback, but if the driver wants to take a copy of the pointer it must call \fBparport_get_port\fR to do so\&. Calling \fBparport_register_device\fR on that port will do this for you\&. .PP The driver\*(Aqs \fBdetach\fR function may block\&. The port that \fBdetach\fR is given will be valid for the duration of the callback, but if the driver wants to take a copy of the pointer it must call \fBparport_get_port\fR to do so\&. .PP .PP Returns 0 on success\&. The non device model will always succeeds\&. but the new device model can fail and will return the error code\&. .SH "COPYRIGHT" .br