diff options
author | Tejun Heo <htejun@gmail.com> | 2007-04-17 10:44:07 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-28 14:16:03 -0400 |
commit | f31871951b38daf2d7ca17daad59fdb735062da3 (patch) | |
tree | 4286402eaf679b6fb73e893d8e51bb693559091d /drivers/ata/libata.h | |
parent | ecef7253235e7a9365afe08a508e11bed91c1c11 (diff) |
libata: separate out ata_host_alloc() and ata_host_register()
Reorganize ata_host_alloc() and its subroutines into the following
three functions.
* ata_host_alloc() : allocates host and its ports. shost is not
registered automatically.
* ata_scsi_add_hosts() : allocates and adds shosts associated with an
ATA host. Used by ata_host_register().
* ata_host_register() : takes a fully initialized ata_host structure
and registers it to libata layer and probes it.
Only ata_host_alloc() and ata_host_register() are exported.
ata_device_add() is rewritten using the above functions. This patch
does not introduce any observable behavior change. Things worth
mentioning.
* print_id is assigned at registration time and LLDs are allowed to
overallocate ports and reduce host->n_ports during initialization.
ata_host_register() will throw away unused ports automatically.
* All SCSI host initialization stuff now resides in
ata_scsi_add_hosts() in libata-scsi.c, where it should be.
* ipr is now the only user of ata_host_init(). Either kill it by
converting ipr to use ata_host_alloc() and friends or rename and
move it to libata-scsi.c
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata.h')
-rw-r--r-- | drivers/ata/libata.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index 1f1e3a51f859..b4d5253d627a 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h | |||
@@ -52,6 +52,7 @@ enum { | |||
52 | ATA_DNXFER_QUIET = (1 << 31), | 52 | ATA_DNXFER_QUIET = (1 << 31), |
53 | }; | 53 | }; |
54 | 54 | ||
55 | extern unsigned int ata_print_id; | ||
55 | extern struct workqueue_struct *ata_aux_wq; | 56 | extern struct workqueue_struct *ata_aux_wq; |
56 | extern int atapi_enabled; | 57 | extern int atapi_enabled; |
57 | extern int atapi_dmadir; | 58 | extern int atapi_dmadir; |
@@ -92,10 +93,9 @@ extern int ata_flush_cache(struct ata_device *dev); | |||
92 | extern void ata_dev_init(struct ata_device *dev); | 93 | extern void ata_dev_init(struct ata_device *dev); |
93 | extern int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg); | 94 | extern int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg); |
94 | extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg); | 95 | extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg); |
95 | extern void ata_port_init(struct ata_port *ap, struct ata_host *host, | ||
96 | const struct ata_probe_ent *ent, unsigned int port_no); | ||
97 | extern struct ata_probe_ent *ata_probe_ent_alloc(struct device *dev, | 96 | extern struct ata_probe_ent *ata_probe_ent_alloc(struct device *dev, |
98 | const struct ata_port_info *port); | 97 | const struct ata_port_info *port); |
98 | extern struct ata_port *ata_port_alloc(struct ata_host *host); | ||
99 | 99 | ||
100 | /* libata-acpi.c */ | 100 | /* libata-acpi.c */ |
101 | #ifdef CONFIG_SATA_ACPI | 101 | #ifdef CONFIG_SATA_ACPI |
@@ -113,8 +113,8 @@ static inline int ata_acpi_push_id(struct ata_port *ap, unsigned int ix) | |||
113 | #endif | 113 | #endif |
114 | 114 | ||
115 | /* libata-scsi.c */ | 115 | /* libata-scsi.c */ |
116 | extern struct scsi_transport_template ata_scsi_transport_template; | 116 | extern int ata_scsi_add_hosts(struct ata_host *host, |
117 | 117 | struct scsi_host_template *sht); | |
118 | extern void ata_scsi_scan_host(struct ata_port *ap); | 118 | extern void ata_scsi_scan_host(struct ata_port *ap); |
119 | extern int ata_scsi_offline_dev(struct ata_device *dev); | 119 | extern int ata_scsi_offline_dev(struct ata_device *dev); |
120 | extern void ata_scsi_hotplug(struct work_struct *work); | 120 | extern void ata_scsi_hotplug(struct work_struct *work); |