aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/scc_pata.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2009-04-08 14:13:03 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-04-08 14:13:03 +0200
commitc9ff9e7b64138d87023b733e618f29a1d58543f7 (patch)
treee0697999409235309c578d3c8a7ecc031be2eda0 /drivers/ide/scc_pata.c
parent30881b9ac91e7c23e0ceb8414ab7de1961809bdd (diff)
downloadkernel_samsung_smdk4412-c9ff9e7b64138d87023b733e618f29a1d58543f7.zip
kernel_samsung_smdk4412-c9ff9e7b64138d87023b733e618f29a1d58543f7.tar.gz
kernel_samsung_smdk4412-c9ff9e7b64138d87023b733e618f29a1d58543f7.tar.bz2
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 feabf54..5ecb70c 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,
return rc;
}
-static void scc_tf_load(ide_drive_t *drive, struct ide_cmd *cmd)
+static void scc_tf_load(ide_drive_t *drive, struct ide_taskfile *tf, u8 valid)
{
struct ide_io_ports *io_ports = &drive->hwif->io_ports;
- struct ide_taskfile *tf = &cmd->hob;
- u8 valid = cmd->valid.out.hob;
-
- if (valid & IDE_VALID_FEATURE)
- scc_ide_outb(tf->feature, io_ports->feature_addr);
- if (valid & IDE_VALID_NSECT)
- scc_ide_outb(tf->nsect, io_ports->nsect_addr);
- if (valid & IDE_VALID_LBAL)
- scc_ide_outb(tf->lbal, io_ports->lbal_addr);
- if (valid & IDE_VALID_LBAM)
- scc_ide_outb(tf->lbam, io_ports->lbam_addr);
- if (valid & IDE_VALID_LBAH)
- scc_ide_outb(tf->lbah, io_ports->lbah_addr);
-
- tf = &cmd->tf;
- valid = cmd->valid.out.tf;
if (valid & IDE_VALID_FEATURE)
scc_ide_outb(tf->feature, io_ports->feature_addr);