'\" t .\" Title: ata_host_alloc .\" Author: .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: libata Library .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "ATA_HOST_ALLOC" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "libata Library" .\" ----------------------------------------------------------------- .\" * 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" ata_host_alloc \- allocate and init basic ATA host resources .SH "SYNOPSIS" .HP \w'struct\ ata_host\ *\ ata_host_alloc('u .BI "struct ata_host * ata_host_alloc(struct\ device\ *\ " "dev" ", int\ " "max_ports" ");" .SH "ARGUMENTS" .PP \fIdev\fR .RS 4 generic device this host is associated with .RE .PP \fImax_ports\fR .RS 4 maximum number of ATA ports associated with this host .RE .SH "DESCRIPTION" .PP Allocate and initialize basic ATA host resources\&. LLD calls this function to allocate a host, initializes it fully and attaches it using \fBata_host_register\fR\&. .PP \fImax_ports\fR ports are allocated and host\->n_ports is initialized to \fImax_ports\fR\&. The caller is allowed to decrease host\->n_ports before calling \fBata_host_register\fR\&. The unused ports will be automatically freed on registration\&. .SH "RETURN" .PP Allocate ATA host on success, NULL on failure\&. .PP LOCKING: Inherited from calling layer (may sleep)\&. .SH "AUTHOR" .PP \fBJeff Garzik\fR .RS 4 Author. .RE .SH "COPYRIGHT" .br