aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-io-std.c12
-rw-r--r--drivers/ide/ns87415.c4
-rw-r--r--drivers/ide/scc_pata.c4
3 files changed, 8 insertions, 12 deletions
diff --git a/drivers/ide/ide-io-std.c b/drivers/ide/ide-io-std.c
index 7950b3bb4312..66c27768e85b 100644
--- a/drivers/ide/ide-io-std.c
+++ b/drivers/ide/ide-io-std.c
@@ -133,21 +133,17 @@ void ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
133 ide_hwif_t *hwif = drive->hwif; 133 ide_hwif_t *hwif = drive->hwif;
134 struct ide_io_ports *io_ports = &hwif->io_ports; 134 struct ide_io_ports *io_ports = &hwif->io_ports;
135 struct ide_taskfile *tf = &cmd->tf; 135 struct ide_taskfile *tf = &cmd->tf;
136 void (*tf_outb)(u8 addr, unsigned long port);
137 u8 (*tf_inb)(unsigned long port); 136 u8 (*tf_inb)(unsigned long port);
138 u8 valid = cmd->valid.in.tf; 137 u8 valid = cmd->valid.in.tf;
139 u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0; 138 u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0;
140 139
141 if (mmio) { 140 if (mmio)
142 tf_outb = ide_mm_outb;
143 tf_inb = ide_mm_inb; 141 tf_inb = ide_mm_inb;
144 } else { 142 else
145 tf_outb = ide_outb;
146 tf_inb = ide_inb; 143 tf_inb = ide_inb;
147 }
148 144
149 /* be sure we're looking at the low order bits */ 145 /* be sure we're looking at the low order bits */
150 tf_outb(ATA_DEVCTL_OBS, io_ports->ctl_addr); 146 hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
151 147
152 if (valid & IDE_VALID_ERROR) 148 if (valid & IDE_VALID_ERROR)
153 tf->error = tf_inb(io_ports->feature_addr); 149 tf->error = tf_inb(io_ports->feature_addr);
@@ -163,7 +159,7 @@ void ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
163 tf->device = tf_inb(io_ports->device_addr); 159 tf->device = tf_inb(io_ports->device_addr);
164 160
165 if (cmd->tf_flags & IDE_TFLAG_LBA48) { 161 if (cmd->tf_flags & IDE_TFLAG_LBA48) {
166 tf_outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr); 162 hwif->tp_ops->write_devctl(hwif, ATA_HOB | ATA_DEVCTL_OBS);
167 163
168 tf = &cmd->hob; 164 tf = &cmd->hob;
169 valid = cmd->valid.in.hob; 165 valid = cmd->valid.in.hob;
diff --git a/drivers/ide/ns87415.c b/drivers/ide/ns87415.c
index 3ab5bb196d2f..f1305f4d2be7 100644
--- a/drivers/ide/ns87415.c
+++ b/drivers/ide/ns87415.c
@@ -68,7 +68,7 @@ static void superio_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
68 u8 valid = cmd->valid.in.tf; 68 u8 valid = cmd->valid.in.tf;
69 69
70 /* be sure we're looking at the low order bits */ 70 /* be sure we're looking at the low order bits */
71 outb(ATA_DEVCTL_OBS, io_ports->ctl_addr); 71 ide_write_devctl(hwif, ATA_DEVCTL_OBS);
72 72
73 if (valid & IDE_VALID_ERROR) 73 if (valid & IDE_VALID_ERROR)
74 tf->error = inb(io_ports->feature_addr); 74 tf->error = inb(io_ports->feature_addr);
@@ -84,7 +84,7 @@ static void superio_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
84 tf->device = superio_ide_inb(io_ports->device_addr); 84 tf->device = superio_ide_inb(io_ports->device_addr);
85 85
86 if (cmd->tf_flags & IDE_TFLAG_LBA48) { 86 if (cmd->tf_flags & IDE_TFLAG_LBA48) {
87 outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr); 87 ide_write_devctl(hwif, ATA_HOB | ATA_DEVCTL_OBS);
88 88
89 tf = &cmd->hob; 89 tf = &cmd->hob;
90 valid = cmd->valid.in.hob; 90 valid = cmd->valid.in.hob;
diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c
index f5a6fa0a8bea..feabf5487049 100644
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -686,7 +686,7 @@ static void scc_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
686 u8 valid = cmd->valid.in.tf; 686 u8 valid = cmd->valid.in.tf;
687 687
688 /* be sure we're looking at the low order bits */ 688 /* be sure we're looking at the low order bits */
689 scc_ide_outb(ATA_DEVCTL_OBS, io_ports->ctl_addr); 689 scc_write_devctl(hwif, ATA_DEVCTL_OBS);
690 690
691 if (valid & IDE_VALID_ERROR) 691 if (valid & IDE_VALID_ERROR)
692 tf->error = scc_ide_inb(io_ports->feature_addr); 692 tf->error = scc_ide_inb(io_ports->feature_addr);
@@ -702,7 +702,7 @@ static void scc_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
702 tf->device = scc_ide_inb(io_ports->device_addr); 702 tf->device = scc_ide_inb(io_ports->device_addr);
703 703
704 if (cmd->tf_flags & IDE_TFLAG_LBA48) { 704 if (cmd->tf_flags & IDE_TFLAG_LBA48) {
705 scc_ide_outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr); 705 scc_write_devctl(hwif, ATA_HOB | ATA_DEVCTL_OBS);
706 706
707 tf = &cmd->hob; 707 tf = &cmd->hob;
708 valid = cmd->valid.in.hob; 708 valid = cmd->valid.in.hob;