aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-disk.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:14 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:14 -0500
commitac026ff254b32915bb14ba97a23b4019d137f181 (patch)
treeab5687be210c4016d16fae7a8e51bfc1c41c4c42 /drivers/ide/ide-disk.c
parent7299a3918442dc9a5abb71b9f65b1dd17637c8c0 (diff)
ide: remove 'command_type' field from ide_task_t
* Add 'data_buf' and 'nsect' variables in ide_taskfile_ioctl() to cache data buffer pointer and number of sectors to transfer (this allows us to have only one ide_diag_taskfile() call). * Add IDE_TFLAG_WRITE taskfile flag and use it to check whether the REQ_RW request flag should be set. * Move ->command_type handling from ide_diag_taskfile() to ide_taskfile_ioctl() and use ->req_cmd instead of ->command_type. * Add 'nsect' parameter to ide_raw_taskfile(). * Merge ide_diag_taskfile() into ide_raw_taskfile(). * Initialize ->data_phase explicitly in idedisk_prepare_flush(), ide_start_power_step() and ide_disk_special(). * Remove no longer needed 'command_type' field from ide_task_t. * Add #ifndef/#endif __KERNEL__ to <linux/hdreg.h> around no longer used by kernel IDE_DRIVE_TASK_* and TASKFILE_* defines. There should be no functionality changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-disk.c')
-rw-r--r--drivers/ide/ide-disk.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 747dc6023346..d9a4fe27685d 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -516,12 +516,11 @@ static int get_smart_data(ide_drive_t *drive, u8 *buf, u8 sub_cmd)
516 tf->lbam = SMART_LCYL_PASS; 516 tf->lbam = SMART_LCYL_PASS;
517 tf->lbah = SMART_HCYL_PASS; 517 tf->lbah = SMART_HCYL_PASS;
518 tf->command = WIN_SMART; 518 tf->command = WIN_SMART;
519 args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; 519 args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
520 args.command_type = IDE_DRIVE_TASK_IN; 520 args.data_phase = TASKFILE_IN;
521 args.data_phase = TASKFILE_IN; 521 args.handler = task_in_intr;
522 args.handler = &task_in_intr;
523 (void) smart_enable(drive); 522 (void) smart_enable(drive);
524 return ide_raw_taskfile(drive, &args, buf); 523 return ide_raw_taskfile(drive, &args, buf, 1);
525} 524}
526 525
527static int proc_idedisk_read_cache 526static int proc_idedisk_read_cache
@@ -607,9 +606,9 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
607 task.tf.command = WIN_FLUSH_CACHE_EXT; 606 task.tf.command = WIN_FLUSH_CACHE_EXT;
608 else 607 else
609 task.tf.command = WIN_FLUSH_CACHE; 608 task.tf.command = WIN_FLUSH_CACHE;
610 task.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; 609 task.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
611 task.command_type = IDE_DRIVE_TASK_NO_DATA; 610 task.data_phase = TASKFILE_NO_DATA;
612 task.handler = task_no_data_intr; 611 task.handler = task_no_data_intr;
613 612
614 rq->cmd_type = REQ_TYPE_ATA_TASKFILE; 613 rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
615 rq->cmd_flags |= REQ_SOFTBARRIER; 614 rq->cmd_flags |= REQ_SOFTBARRIER;