aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_fsl.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-04-07 09:47:20 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-04-17 15:44:23 -0400
commit4c9bf4e799ce06a7378f1196587084802a414c03 (patch)
tree70a7d3741e756b975468850537f222349143a0be /drivers/ata/sata_fsl.c
parent79f97dadfe9b4b561634d202225ba2fa910dc225 (diff)
libata: replace tf_read with qc_fill_rtf for non-SFF drivers
Now that all SFF stuff is separated out of core layer, core layer doesn't call ops->tf_read directly. It gets called only via ops->qc_fill_rtf() for non-SFF drivers. This patch directly implements private ops->qc_fill_rtf() for non-SFF controllers and kill ops->tf_read(). This is much cleaner for non-SFF controllers as some of them have to cache SFF register values in private data structure and report the cached values via ops->tf_read(). Also, ops->tf_read() gets nasty for controllers which don't have clear notion of TF registers when operation is not in progress. As this change makes default ops->qc_fill_rtf unnecessary, move ata_sff_qc_fill_rtf() form ata_base_port_ops to ata_sff_port_ops where it belongs. Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/ata/sata_fsl.c')
-rw-r--r--drivers/ata/sata_fsl.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 37482d4e883f..e880b7ec060f 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -464,6 +464,20 @@ static unsigned int sata_fsl_qc_issue(struct ata_queued_cmd *qc)
464 return 0; 464 return 0;
465} 465}
466 466
467static bool sata_fsl_qc_fill_rtf(struct ata_queued_cmd *qc)
468{
469 struct sata_fsl_port_priv *pp = qc->ap->private_data;
470 struct sata_fsl_host_priv *host_priv = qc->ap->host->private_data;
471 void __iomem *hcr_base = host_priv->hcr_base;
472 unsigned int tag = sata_fsl_tag(qc->tag, hcr_base);
473 struct command_desc *cd;
474
475 cd = pp->cmdentry + tag;
476
477 ata_tf_from_fis(cd->sfis, &qc->result_tf);
478 return true;
479}
480
467static int sata_fsl_scr_write(struct ata_port *ap, unsigned int sc_reg_in, 481static int sata_fsl_scr_write(struct ata_port *ap, unsigned int sc_reg_in,
468 u32 val) 482 u32 val)
469{ 483{
@@ -580,13 +594,6 @@ static u8 sata_fsl_check_status(struct ata_port *ap)
580 return pp->tf.command; 594 return pp->tf.command;
581} 595}
582 596
583static void sata_fsl_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
584{
585 struct sata_fsl_port_priv *pp = ap->private_data;
586
587 *tf = pp->tf;
588}
589
590static int sata_fsl_port_start(struct ata_port *ap) 597static int sata_fsl_port_start(struct ata_port *ap)
591{ 598{
592 struct device *dev = ap->host->dev; 599 struct device *dev = ap->host->dev;
@@ -1193,10 +1200,9 @@ static const struct ata_port_operations sata_fsl_ops = {
1193 .sff_check_status = sata_fsl_check_status, 1200 .sff_check_status = sata_fsl_check_status,
1194 .sff_check_altstatus = sata_fsl_check_status, 1201 .sff_check_altstatus = sata_fsl_check_status,
1195 1202
1196 .sff_tf_read = sata_fsl_tf_read,
1197
1198 .qc_prep = sata_fsl_qc_prep, 1203 .qc_prep = sata_fsl_qc_prep,
1199 .qc_issue = sata_fsl_qc_issue, 1204 .qc_issue = sata_fsl_qc_issue,
1205 .qc_fill_rtf = sata_fsl_qc_fill_rtf,
1200 1206
1201 .scr_read = sata_fsl_scr_read, 1207 .scr_read = sata_fsl_scr_read,
1202 .scr_write = sata_fsl_scr_write, 1208 .scr_write = sata_fsl_scr_write,