aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-iops.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 13:55:53 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 13:55:53 -0400
commit92eb43800a3c1300bd5cb8a2a27e6f2a84f7042e (patch)
tree6c4b7253d2e799f260d7858b99addd0cdac978d2 /drivers/ide/ide-iops.c
parent40f095f0138ea5b5971e5128b27e1bb907161149 (diff)
ide: use ->tf_read in ide_read_error()
* Add IDE_TFLAG_IN_FEATURE taskfile flag for reading Feature register and handle it in ->tf_read. * Convert ide_read_error() to use ->tf_read instead of ->INB, then uninline and export it. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-iops.c')
-rw-r--r--drivers/ide/ide-iops.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 1983b353eb16..113db8744736 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -241,6 +241,8 @@ static void ide_tf_read(ide_drive_t *drive, ide_task_t *task)
241 /* be sure we're looking at the low order bits */ 241 /* be sure we're looking at the low order bits */
242 tf_outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr); 242 tf_outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr);
243 243
244 if (task->tf_flags & IDE_TFLAG_IN_FEATURE)
245 tf->feature = tf_inb(io_ports->feature_addr);
244 if (task->tf_flags & IDE_TFLAG_IN_NSECT) 246 if (task->tf_flags & IDE_TFLAG_IN_NSECT)
245 tf->nsect = tf_inb(io_ports->nsect_addr); 247 tf->nsect = tf_inb(io_ports->nsect_addr);
246 if (task->tf_flags & IDE_TFLAG_IN_LBAL) 248 if (task->tf_flags & IDE_TFLAG_IN_LBAL)
@@ -390,6 +392,19 @@ void default_hwif_transport(ide_hwif_t *hwif)
390 hwif->output_data = ata_output_data; 392 hwif->output_data = ata_output_data;
391} 393}
392 394
395u8 ide_read_error(ide_drive_t *drive)
396{
397 ide_task_t task;
398
399 memset(&task, 0, sizeof(task));
400 task.tf_flags = IDE_TFLAG_IN_FEATURE;
401
402 drive->hwif->tf_read(drive, &task);
403
404 return task.tf.error;
405}
406EXPORT_SYMBOL_GPL(ide_read_error);
407
393void ide_fix_driveid (struct hd_driveid *id) 408void ide_fix_driveid (struct hd_driveid *id)
394{ 409{
395#ifndef __LITTLE_ENDIAN 410#ifndef __LITTLE_ENDIAN