diff options
Diffstat (limited to 'drivers/ide/ide-io-std.c')
-rw-r--r-- | drivers/ide/ide-io-std.c | 12 |
1 files changed, 4 insertions, 8 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; |