From ac026ff254b32915bb14ba97a23b4019d137f181 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 25 Jan 2008 22:17:14 +0100 Subject: 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 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 Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-disk.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'drivers/ide/ide-disk.c') diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 747dc602334..d9a4fe27685 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) tf->lbam = SMART_LCYL_PASS; tf->lbah = SMART_HCYL_PASS; tf->command = WIN_SMART; - args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; - args.command_type = IDE_DRIVE_TASK_IN; - args.data_phase = TASKFILE_IN; - args.handler = &task_in_intr; + args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; + args.data_phase = TASKFILE_IN; + args.handler = task_in_intr; (void) smart_enable(drive); - return ide_raw_taskfile(drive, &args, buf); + return ide_raw_taskfile(drive, &args, buf, 1); } static int proc_idedisk_read_cache @@ -607,9 +606,9 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq) task.tf.command = WIN_FLUSH_CACHE_EXT; else task.tf.command = WIN_FLUSH_CACHE; - task.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; - task.command_type = IDE_DRIVE_TASK_NO_DATA; - task.handler = task_no_data_intr; + task.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; + task.data_phase = TASKFILE_NO_DATA; + task.handler = task_no_data_intr; rq->cmd_type = REQ_TYPE_ATA_TASKFILE; rq->cmd_flags |= REQ_SOFTBARRIER; -- cgit v1.2.3-70-g09d2