aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-io-std.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2009-03-31 14:15:31 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 14:15:31 -0400
commitbac08cee93f9cb37b40ecfa8eaf1f6d8daf3909b (patch)
treee3a5a3dd993077d64e16699e866e37ad66d652c8 /drivers/ide/ide-io-std.c
parentdeae17fd5d147ae65e277905343b7ea578574d12 (diff)
ide: call {in|out}put_data() methods from tf_{read|load}() methods (take 2)
Handle IDE_FTFLAG_{IN|OUT}_DATA flags in tf_{read|load}() methods by calling {in|out}put_data() methods to transfer 2 bytes -- this will allow us to move that handling out of those methods altogether... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-io-std.c')
-rw-r--r--drivers/ide/ide-io-std.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/ide/ide-io-std.c b/drivers/ide/ide-io-std.c
index 96a537da8925..f06940df255e 100644
--- a/drivers/ide/ide-io-std.c
+++ b/drivers/ide/ide-io-std.c
@@ -91,12 +91,9 @@ void ide_tf_load(ide_drive_t *drive, struct ide_cmd *cmd)
91 HIHI = 0xFF; 91 HIHI = 0xFF;
92 92
93 if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) { 93 if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) {
94 u16 data = (tf->hob_data << 8) | tf->data; 94 u8 data[2] = { tf->data, tf->hob_data };
95 95
96 if (mmio) 96 ide_output_data(drive, cmd, data, 2);
97 writew(data, (void __iomem *)io_ports->data_addr);
98 else
99 outw(data, io_ports->data_addr);
100 } 97 }
101 98
102 if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) 99 if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE)
@@ -145,15 +142,12 @@ void ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
145 } 142 }
146 143
147 if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { 144 if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) {
148 u16 data; 145 u8 data[2];
149 146
150 if (mmio) 147 ide_input_data(drive, cmd, data, 2);
151 data = readw((void __iomem *)io_ports->data_addr);
152 else
153 data = inw(io_ports->data_addr);
154 148
155 tf->data = data & 0xff; 149 tf->data = data[0];
156 tf->hob_data = (data >> 8) & 0xff; 150 tf->hob_data = data[1];
157 } 151 }
158 152
159 /* be sure we're looking at the low order bits */ 153 /* be sure we're looking at the low order bits */