aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/scc_pata.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2009-04-08 08:13:03 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-04-08 08:13:03 -0400
commitc9ff9e7b64138d87023b733e618f29a1d58543f7 (patch)
treee0697999409235309c578d3c8a7ecc031be2eda0 /drivers/ide/scc_pata.c
parent30881b9ac91e7c23e0ceb8414ab7de1961809bdd (diff)
ide: refactor tf_load() method
Simplify tf_load() method, making it deal only with 'struct ide_taskfile' and the validity flags that the upper layer passes, and moving the code that deals with the high order bytes into the only function interested, do_rw_taskfile(). This should stop the needless code duplication in this method and so make it about twice smaller than it was; along with simplifying the setup for the method call, this should save both time and space... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/scc_pata.c')
-rw-r--r--drivers/ide/scc_pata.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c
index feabf5487049..5ecb70cf29dc 100644
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -645,25 +645,9 @@ static int __devinit init_setup_scc(struct pci_dev *dev,
645 return rc; 645 return rc;
646} 646}
647 647
648static void scc_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) 648static void scc_tf_load(ide_drive_t *drive, struct ide_taskfile *tf, u8 valid)
649{ 649{
650 struct ide_io_ports *io_ports = &drive->hwif->io_ports; 650 struct ide_io_ports *io_ports = &drive->hwif->io_ports;
651 struct ide_taskfile *tf = &cmd->hob;
652 u8 valid = cmd->valid.out.hob;
653
654 if (valid & IDE_VALID_FEATURE)
655 scc_ide_outb(tf->feature, io_ports->feature_addr);
656 if (valid & IDE_VALID_NSECT)
657 scc_ide_outb(tf->nsect, io_ports->nsect_addr);
658 if (valid & IDE_VALID_LBAL)
659 scc_ide_outb(tf->lbal, io_ports->lbal_addr);
660 if (valid & IDE_VALID_LBAM)
661 scc_ide_outb(tf->lbam, io_ports->lbam_addr);
662 if (valid & IDE_VALID_LBAH)
663 scc_ide_outb(tf->lbah, io_ports->lbah_addr);
664
665 tf = &cmd->tf;
666 valid = cmd->valid.out.tf;
667 651
668 if (valid & IDE_VALID_FEATURE) 652 if (valid & IDE_VALID_FEATURE)
669 scc_ide_outb(tf->feature, io_ports->feature_addr); 653 scc_ide_outb(tf->feature, io_ports->feature_addr);