浏览代码

ide: call write_devctl() method from tf_read() method

Use write_devctl() method to clear/set the HOB bit in tf_read() method.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sergei Shtylyov 16 年之前
父节点
当前提交
30881b9ac9
共有 3 个文件被更改,包括 8 次插入12 次删除
  1. 4 8
      drivers/ide/ide-io-std.c
  2. 2 2
      drivers/ide/ns87415.c
  3. 2 2
      drivers/ide/scc_pata.c

+ 4 - 8
drivers/ide/ide-io-std.c

@@ -133,21 +133,17 @@ void ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
 	ide_hwif_t *hwif = drive->hwif;
 	ide_hwif_t *hwif = drive->hwif;
 	struct ide_io_ports *io_ports = &hwif->io_ports;
 	struct ide_io_ports *io_ports = &hwif->io_ports;
 	struct ide_taskfile *tf = &cmd->tf;
 	struct ide_taskfile *tf = &cmd->tf;
-	void (*tf_outb)(u8 addr, unsigned long port);
 	u8 (*tf_inb)(unsigned long port);
 	u8 (*tf_inb)(unsigned long port);
 	u8 valid = cmd->valid.in.tf;
 	u8 valid = cmd->valid.in.tf;
 	u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0;
 	u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0;
 
 
-	if (mmio) {
-		tf_outb = ide_mm_outb;
+	if (mmio)
 		tf_inb  = ide_mm_inb;
 		tf_inb  = ide_mm_inb;
-	} else {
-		tf_outb = ide_outb;
+	else
 		tf_inb  = ide_inb;
 		tf_inb  = ide_inb;
-	}
 
 
 	/* be sure we're looking at the low order bits */
 	/* be sure we're looking at the low order bits */
-	tf_outb(ATA_DEVCTL_OBS, io_ports->ctl_addr);
+	hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
 
 
 	if (valid & IDE_VALID_ERROR)
 	if (valid & IDE_VALID_ERROR)
 		tf->error  = tf_inb(io_ports->feature_addr);
 		tf->error  = tf_inb(io_ports->feature_addr);
@@ -163,7 +159,7 @@ void ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
 		tf->device = tf_inb(io_ports->device_addr);
 		tf->device = tf_inb(io_ports->device_addr);
 
 
 	if (cmd->tf_flags & IDE_TFLAG_LBA48) {
 	if (cmd->tf_flags & IDE_TFLAG_LBA48) {
-		tf_outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr);
+		hwif->tp_ops->write_devctl(hwif, ATA_HOB | ATA_DEVCTL_OBS);
 
 
 		tf = &cmd->hob;
 		tf = &cmd->hob;
 		valid = cmd->valid.in.hob;
 		valid = cmd->valid.in.hob;

+ 2 - 2
drivers/ide/ns87415.c

@@ -68,7 +68,7 @@ static void superio_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
 	u8 valid = cmd->valid.in.tf;
 	u8 valid = cmd->valid.in.tf;
 
 
 	/* be sure we're looking at the low order bits */
 	/* be sure we're looking at the low order bits */
-	outb(ATA_DEVCTL_OBS, io_ports->ctl_addr);
+	ide_write_devctl(hwif, ATA_DEVCTL_OBS);
 
 
 	if (valid & IDE_VALID_ERROR)
 	if (valid & IDE_VALID_ERROR)
 		tf->error  = inb(io_ports->feature_addr);
 		tf->error  = inb(io_ports->feature_addr);
@@ -84,7 +84,7 @@ static void superio_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
 		tf->device = superio_ide_inb(io_ports->device_addr);
 		tf->device = superio_ide_inb(io_ports->device_addr);
 
 
 	if (cmd->tf_flags & IDE_TFLAG_LBA48) {
 	if (cmd->tf_flags & IDE_TFLAG_LBA48) {
-		outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr);
+		ide_write_devctl(hwif, ATA_HOB | ATA_DEVCTL_OBS);
 
 
 		tf = &cmd->hob;
 		tf = &cmd->hob;
 		valid = cmd->valid.in.hob;
 		valid = cmd->valid.in.hob;

+ 2 - 2
drivers/ide/scc_pata.c

@@ -686,7 +686,7 @@ static void scc_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
 	u8 valid = cmd->valid.in.tf;
 	u8 valid = cmd->valid.in.tf;
 
 
 	/* be sure we're looking at the low order bits */
 	/* be sure we're looking at the low order bits */
-	scc_ide_outb(ATA_DEVCTL_OBS, io_ports->ctl_addr);
+	scc_write_devctl(hwif, ATA_DEVCTL_OBS);
 
 
 	if (valid & IDE_VALID_ERROR)
 	if (valid & IDE_VALID_ERROR)
 		tf->error  = scc_ide_inb(io_ports->feature_addr);
 		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)
 		tf->device = scc_ide_inb(io_ports->device_addr);
 		tf->device = scc_ide_inb(io_ports->device_addr);
 
 
 	if (cmd->tf_flags & IDE_TFLAG_LBA48) {
 	if (cmd->tf_flags & IDE_TFLAG_LBA48) {
-		scc_ide_outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr);
+		scc_write_devctl(hwif, ATA_HOB | ATA_DEVCTL_OBS);
 
 
 		tf = &cmd->hob;
 		tf = &cmd->hob;
 		valid = cmd->valid.in.hob;
 		valid = cmd->valid.in.hob;