diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2009-04-08 08:13:01 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-04-08 08:13:01 -0400 |
commit | 60f85019c6c8c1aebf3485a313e0da094bc95d07 (patch) | |
tree | 5cbb0e1a733b59887308a50ce083613c4e7c0ede /drivers/ide/ns87415.c | |
parent | 674f0ea111bc9bff1b4e4841d7da38933c5e3b59 (diff) |
ide: replace IDE_TFLAG_* flags by IDE_VALID_*
Replace IDE_TFLAG_{IN|OUT}_* flags meaning to the taskfile register validity on
input/output by the IDE_VALID_* flags and introduce 4 symmetric 8-bit register
validity indicator subfields, 'valid.{input/output}.{tf|hob}', into the 'struct
ide_cmd' instead of using the 'tf_flags' field for that purpose (this field can
then be turned from 32-bit into 8-bit one).
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ns87415.c')
-rw-r--r-- | drivers/ide/ns87415.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/ide/ns87415.c b/drivers/ide/ns87415.c index 71a39fb3856f..0208dd35c1a3 100644 --- a/drivers/ide/ns87415.c +++ b/drivers/ide/ns87415.c | |||
@@ -65,35 +65,38 @@ static void superio_tf_read(ide_drive_t *drive, struct ide_cmd *cmd) | |||
65 | { | 65 | { |
66 | struct ide_io_ports *io_ports = &drive->hwif->io_ports; | 66 | struct ide_io_ports *io_ports = &drive->hwif->io_ports; |
67 | struct ide_taskfile *tf = &cmd->tf; | 67 | struct ide_taskfile *tf = &cmd->tf; |
68 | u8 valid = cmd->valid.in.tf; | ||
68 | 69 | ||
69 | /* be sure we're looking at the low order bits */ | 70 | /* be sure we're looking at the low order bits */ |
70 | outb(ATA_DEVCTL_OBS, io_ports->ctl_addr); | 71 | outb(ATA_DEVCTL_OBS, io_ports->ctl_addr); |
71 | 72 | ||
72 | if (cmd->tf_flags & IDE_TFLAG_IN_ERROR) | 73 | if (valid & IDE_VALID_ERROR) |
73 | tf->error = inb(io_ports->feature_addr); | 74 | tf->error = inb(io_ports->feature_addr); |
74 | if (cmd->tf_flags & IDE_TFLAG_IN_NSECT) | 75 | if (valid & IDE_VALID_NSECT) |
75 | tf->nsect = inb(io_ports->nsect_addr); | 76 | tf->nsect = inb(io_ports->nsect_addr); |
76 | if (cmd->tf_flags & IDE_TFLAG_IN_LBAL) | 77 | if (valid & IDE_VALID_LBAL) |
77 | tf->lbal = inb(io_ports->lbal_addr); | 78 | tf->lbal = inb(io_ports->lbal_addr); |
78 | if (cmd->tf_flags & IDE_TFLAG_IN_LBAM) | 79 | if (valid & IDE_VALID_LBAM) |
79 | tf->lbam = inb(io_ports->lbam_addr); | 80 | tf->lbam = inb(io_ports->lbam_addr); |
80 | if (cmd->tf_flags & IDE_TFLAG_IN_LBAH) | 81 | if (valid & IDE_VALID_LBAH) |
81 | tf->lbah = inb(io_ports->lbah_addr); | 82 | tf->lbah = inb(io_ports->lbah_addr); |
82 | if (cmd->tf_flags & IDE_TFLAG_IN_DEVICE) | 83 | if (valid & IDE_VALID_DEVICE) |
83 | tf->device = superio_ide_inb(io_ports->device_addr); | 84 | tf->device = superio_ide_inb(io_ports->device_addr); |
84 | 85 | ||
85 | if (cmd->tf_flags & IDE_TFLAG_LBA48) { | 86 | if (cmd->tf_flags & IDE_TFLAG_LBA48) { |
86 | outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr); | 87 | outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr); |
87 | 88 | ||
88 | if (cmd->tf_flags & IDE_TFLAG_IN_HOB_ERROR) | 89 | valid = cmd->valid.in.hob; |
90 | |||
91 | if (valid & IDE_VALID_ERROR) | ||
89 | tf->hob_error = inb(io_ports->feature_addr); | 92 | tf->hob_error = inb(io_ports->feature_addr); |
90 | if (cmd->tf_flags & IDE_TFLAG_IN_HOB_NSECT) | 93 | if (valid & IDE_VALID_NSECT) |
91 | tf->hob_nsect = inb(io_ports->nsect_addr); | 94 | tf->hob_nsect = inb(io_ports->nsect_addr); |
92 | if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAL) | 95 | if (valid & IDE_VALID_LBAL) |
93 | tf->hob_lbal = inb(io_ports->lbal_addr); | 96 | tf->hob_lbal = inb(io_ports->lbal_addr); |
94 | if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAM) | 97 | if (valid & IDE_VALID_LBAM) |
95 | tf->hob_lbam = inb(io_ports->lbam_addr); | 98 | tf->hob_lbam = inb(io_ports->lbam_addr); |
96 | if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAH) | 99 | if (valid & IDE_VALID_LBAH) |
97 | tf->hob_lbah = inb(io_ports->lbah_addr); | 100 | tf->hob_lbah = inb(io_ports->lbah_addr); |
98 | } | 101 | } |
99 | } | 102 | } |