1. NAME▲

ata_host_alloc - allocate and init basic ATA host resources

2. SYNOPSIS ▲

struct ata_host * ata_host_alloc(struct device *  dev , int  max_ports );

3. ARGUMENTS ▲

dev
    generic device this host is associated with

max_ports
    maximum number of ATA ports associated with this host

4. DESCRIPTION ▲

Allocate and initialize basic ATA host resources. LLD calls this function to allocate a host, initializes it fully and attaches it using ata_host_register.

max_ports ports are allocated and host->n_ports is initialized to max_ports. The caller is allowed to decrease host->n_ports before calling ata_host_register. The unused ports will be automatically freed on registration.

5. RETURNS ▲

Allocate ATA host on success, NULL on failure.

6. LOCKING ▲

Inherited from calling layer (may sleep).

7. AUTHOR ▲

Jeff Garzik
    Author.

8. COPYRIGHT ▲