aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-11-27 05:28:55 -0500
committerJeff Garzik <jeff@garzik.org>2008-01-23 05:24:10 -0500
commit6f1d1e3a03fd04a9d9c82fd3cf414020097bb142 (patch)
treeceb7917e7ca056c2884ef9dd2a239945ad45724c /drivers
parent02c05a27e884c9655dae5b1c8bc0cd89c060c43d (diff)
libata: move ata_set_mode() to libata-eh.c
Move ata_set_mode() to libata-eh.c. ata_set_mode() is surely an EH action and will be more tightly coupled with the rest of error handling. Move it to libata-eh.c. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/libata-core.c25
-rw-r--r--drivers/ata/libata-eh.c25
-rw-r--r--drivers/ata/libata.h2
3 files changed, 26 insertions, 26 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 8c7af2c8e8d4..86c10cc751e9 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3183,31 +3183,6 @@ int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev)
3183} 3183}
3184 3184
3185/** 3185/**
3186 * ata_set_mode - Program timings and issue SET FEATURES - XFER
3187 * @link: link on which timings will be programmed
3188 * @r_failed_dev: out paramter for failed device
3189 *
3190 * Set ATA device disk transfer mode (PIO3, UDMA6, etc.). If
3191 * ata_set_mode() fails, pointer to the failing device is
3192 * returned in @r_failed_dev.
3193 *
3194 * LOCKING:
3195 * PCI/etc. bus probe sem.
3196 *
3197 * RETURNS:
3198 * 0 on success, negative errno otherwise
3199 */
3200int ata_set_mode(struct ata_link *link, struct ata_device **r_failed_dev)
3201{
3202 struct ata_port *ap = link->ap;
3203
3204 /* has private set_mode? */
3205 if (ap->ops->set_mode)
3206 return ap->ops->set_mode(link, r_failed_dev);
3207 return ata_do_set_mode(link, r_failed_dev);
3208}
3209
3210/**
3211 * ata_tf_to_host - issue ATA taskfile to host controller 3186 * ata_tf_to_host - issue ATA taskfile to host controller
3212 * @ap: port to which command is being issued 3187 * @ap: port to which command is being issued
3213 * @tf: ATA taskfile register set 3188 * @tf: ATA taskfile register set
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index b16c81a24ba3..ebab75958900 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2329,6 +2329,31 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,
2329 return rc; 2329 return rc;
2330} 2330}
2331 2331
2332/**
2333 * ata_set_mode - Program timings and issue SET FEATURES - XFER
2334 * @link: link on which timings will be programmed
2335 * @r_failed_dev: out paramter for failed device
2336 *
2337 * Set ATA device disk transfer mode (PIO3, UDMA6, etc.). If
2338 * ata_set_mode() fails, pointer to the failing device is
2339 * returned in @r_failed_dev.
2340 *
2341 * LOCKING:
2342 * PCI/etc. bus probe sem.
2343 *
2344 * RETURNS:
2345 * 0 on success, negative errno otherwise
2346 */
2347int ata_set_mode(struct ata_link *link, struct ata_device **r_failed_dev)
2348{
2349 struct ata_port *ap = link->ap;
2350
2351 /* has private set_mode? */
2352 if (ap->ops->set_mode)
2353 return ap->ops->set_mode(link, r_failed_dev);
2354 return ata_do_set_mode(link, r_failed_dev);
2355}
2356
2332static int ata_link_nr_enabled(struct ata_link *link) 2357static int ata_link_nr_enabled(struct ata_link *link)
2333{ 2358{
2334 struct ata_device *dev; 2359 struct ata_device *dev;
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index 8cf0874f248b..409ffb9af163 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -86,7 +86,6 @@ extern int ata_dev_configure(struct ata_device *dev);
86extern int sata_down_spd_limit(struct ata_link *link); 86extern int sata_down_spd_limit(struct ata_link *link);
87extern int sata_set_spd_needed(struct ata_link *link); 87extern int sata_set_spd_needed(struct ata_link *link);
88extern int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel); 88extern int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel);
89extern int ata_set_mode(struct ata_link *link, struct ata_device **r_failed_dev);
90extern void ata_sg_clean(struct ata_queued_cmd *qc); 89extern void ata_sg_clean(struct ata_queued_cmd *qc);
91extern void ata_qc_free(struct ata_queued_cmd *qc); 90extern void ata_qc_free(struct ata_queued_cmd *qc);
92extern void ata_qc_issue(struct ata_queued_cmd *qc); 91extern void ata_qc_issue(struct ata_queued_cmd *qc);
@@ -187,6 +186,7 @@ extern void ata_eh_report(struct ata_port *ap);
187extern int ata_eh_reset(struct ata_link *link, int classify, 186extern int ata_eh_reset(struct ata_link *link, int classify,
188 ata_prereset_fn_t prereset, ata_reset_fn_t softreset, 187 ata_prereset_fn_t prereset, ata_reset_fn_t softreset,
189 ata_reset_fn_t hardreset, ata_postreset_fn_t postreset); 188 ata_reset_fn_t hardreset, ata_postreset_fn_t postreset);
189extern int ata_set_mode(struct ata_link *link, struct ata_device **r_failed_dev);
190extern int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset, 190extern int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
191 ata_reset_fn_t softreset, ata_reset_fn_t hardreset, 191 ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
192 ata_postreset_fn_t postreset, 192 ata_postreset_fn_t postreset,