diff options
author | Tejun Heo <tj@kernel.org> | 2009-01-29 06:31:30 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2009-02-02 23:03:00 -0500 |
commit | 678afac678061ee41bc3007885003c125912a8e2 (patch) | |
tree | 134b4227b0826d14810f0d617090d5b7fe5e4369 /drivers/ata | |
parent | d89293abd95bfd7dd9229087d6c30c1464c5ac83 (diff) |
libata: move ata_dev_disable() to libata-eh.c
ata_dev_disable() is about to be more tightly integrated into EH
logic. Move it to libata-eh.c.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/libata-core.c | 12 | ||||
-rw-r--r-- | drivers/ata/libata-eh.c | 21 | ||||
-rw-r--r-- | drivers/ata/libata.h | 2 |
3 files changed, 22 insertions, 13 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 574715d0b0fc..af60d2715825 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1015,18 +1015,6 @@ static const char *sata_spd_string(unsigned int spd) | |||
1015 | return spd_str[spd - 1]; | 1015 | return spd_str[spd - 1]; |
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | void ata_dev_disable(struct ata_device *dev) | ||
1019 | { | ||
1020 | if (ata_dev_enabled(dev)) { | ||
1021 | if (ata_msg_drv(dev->link->ap)) | ||
1022 | ata_dev_printk(dev, KERN_WARNING, "disabled\n"); | ||
1023 | ata_acpi_on_disable(dev); | ||
1024 | ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 | | ||
1025 | ATA_DNXFER_QUIET); | ||
1026 | dev->class++; | ||
1027 | } | ||
1028 | } | ||
1029 | |||
1030 | static int ata_dev_set_dipm(struct ata_device *dev, enum link_pm policy) | 1018 | static int ata_dev_set_dipm(struct ata_device *dev, enum link_pm policy) |
1031 | { | 1019 | { |
1032 | struct ata_link *link = dev->link; | 1020 | struct ata_link *link = dev->link; |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index c15572d22a3b..aafe82bf5e2e 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1176,6 +1176,27 @@ void ata_eh_qc_retry(struct ata_queued_cmd *qc) | |||
1176 | } | 1176 | } |
1177 | 1177 | ||
1178 | /** | 1178 | /** |
1179 | * ata_dev_disable - disable ATA device | ||
1180 | * @dev: ATA device to disable | ||
1181 | * | ||
1182 | * Disable @dev. | ||
1183 | * | ||
1184 | * Locking: | ||
1185 | * EH context. | ||
1186 | */ | ||
1187 | void ata_dev_disable(struct ata_device *dev) | ||
1188 | { | ||
1189 | if (!ata_dev_enabled(dev)) | ||
1190 | return; | ||
1191 | |||
1192 | if (ata_msg_drv(dev->link->ap)) | ||
1193 | ata_dev_printk(dev, KERN_WARNING, "disabled\n"); | ||
1194 | ata_acpi_on_disable(dev); | ||
1195 | ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 | ATA_DNXFER_QUIET); | ||
1196 | dev->class++; | ||
1197 | } | ||
1198 | |||
1199 | /** | ||
1179 | * ata_eh_detach_dev - detach ATA device | 1200 | * ata_eh_detach_dev - detach ATA device |
1180 | * @dev: ATA device to detach | 1201 | * @dev: ATA device to detach |
1181 | * | 1202 | * |
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index fe2839e58774..0a6f5be15112 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h | |||
@@ -79,7 +79,6 @@ extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, | |||
79 | u64 block, u32 n_block, unsigned int tf_flags, | 79 | u64 block, u32 n_block, unsigned int tf_flags, |
80 | unsigned int tag); | 80 | unsigned int tag); |
81 | extern u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev); | 81 | extern u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev); |
82 | extern void ata_dev_disable(struct ata_device *dev); | ||
83 | extern void ata_pio_queue_task(struct ata_port *ap, void *data, | 82 | extern void ata_pio_queue_task(struct ata_port *ap, void *data, |
84 | unsigned long delay); | 83 | unsigned long delay); |
85 | extern void ata_port_flush_task(struct ata_port *ap); | 84 | extern void ata_port_flush_task(struct ata_port *ap); |
@@ -160,6 +159,7 @@ extern void ata_scsi_error(struct Scsi_Host *host); | |||
160 | extern void ata_port_wait_eh(struct ata_port *ap); | 159 | extern void ata_port_wait_eh(struct ata_port *ap); |
161 | extern void ata_eh_fastdrain_timerfn(unsigned long arg); | 160 | extern void ata_eh_fastdrain_timerfn(unsigned long arg); |
162 | extern void ata_qc_schedule_eh(struct ata_queued_cmd *qc); | 161 | extern void ata_qc_schedule_eh(struct ata_queued_cmd *qc); |
162 | extern void ata_dev_disable(struct ata_device *dev); | ||
163 | extern void ata_eh_detach_dev(struct ata_device *dev); | 163 | extern void ata_eh_detach_dev(struct ata_device *dev); |
164 | extern void ata_eh_about_to_do(struct ata_link *link, struct ata_device *dev, | 164 | extern void ata_eh_about_to_do(struct ata_link *link, struct ata_device *dev, |
165 | unsigned int action); | 165 | unsigned int action); |