aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:16 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:16 -0500
commit1192e528e064ebb9a578219731d2b0f78ca3c1ec (patch)
treed220412f152337618cbb19dac35c98016258e9b8 /drivers
parent10d90157c83d4b6743c9063c36f9e7f27aa254b6 (diff)
ide: use ->data_phase to set ->handler in do_rw_taskfile()
* Use ->data_phase to set ->handler in do_rw_taskfile() instead of setting ->handler in callers of ide_raw_taskfile()/do_rw_taskfile(). * Unexport task_no_data_intr() and make it static. 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')
-rw-r--r--drivers/ide/ide-disk.c2
-rw-r--r--drivers/ide/ide-io.c1
-rw-r--r--drivers/ide/ide-taskfile.c16
3 files changed, 10 insertions, 9 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 424207e67f9c..a063957e9add 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -518,7 +518,6 @@ static int get_smart_data(ide_drive_t *drive, u8 *buf, u8 sub_cmd)
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.data_phase = TASKFILE_IN; 520 args.data_phase = TASKFILE_IN;
521 args.handler = task_in_intr;
522 (void) smart_enable(drive); 521 (void) smart_enable(drive);
523 return ide_raw_taskfile(drive, &args, buf, 1); 522 return ide_raw_taskfile(drive, &args, buf, 1);
524} 523}
@@ -608,7 +607,6 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
608 task.tf.command = WIN_FLUSH_CACHE; 607 task.tf.command = WIN_FLUSH_CACHE;
609 task.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; 608 task.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
610 task.data_phase = TASKFILE_NO_DATA; 609 task.data_phase = TASKFILE_NO_DATA;
611 task.handler = task_no_data_intr;
612 610
613 rq->cmd_type = REQ_TYPE_ATA_TASKFILE; 611 rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
614 rq->cmd_flags |= REQ_SOFTBARRIER; 612 rq->cmd_flags |= REQ_SOFTBARRIER;
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 1af2cc4f864e..18ac1bd0811f 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -234,7 +234,6 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
234out_do_tf: 234out_do_tf:
235 args->tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; 235 args->tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
236 args->data_phase = TASKFILE_NO_DATA; 236 args->data_phase = TASKFILE_NO_DATA;
237 args->handler = task_no_data_intr;
238 return do_rw_taskfile(drive, args); 237 return do_rw_taskfile(drive, args);
239} 238}
240 239
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 5f6d01a4222c..835465d61f70 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -128,7 +128,6 @@ int taskfile_lib_get_identify (ide_drive_t *drive, u8 *buf)
128 args.tf.command = WIN_PIDENTIFY; 128 args.tf.command = WIN_PIDENTIFY;
129 args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; 129 args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
130 args.data_phase = TASKFILE_IN; 130 args.data_phase = TASKFILE_IN;
131 args.handler = task_in_intr;
132 return ide_raw_taskfile(drive, &args, buf, 1); 131 return ide_raw_taskfile(drive, &args, buf, 1);
133} 132}
134 133
@@ -151,6 +150,9 @@ static int inline task_dma_ok(ide_task_t *task)
151 return 0; 150 return 0;
152} 151}
153 152
153static ide_startstop_t task_no_data_intr(ide_drive_t *);
154static ide_startstop_t task_out_intr(ide_drive_t *);
155
154ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task) 156ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
155{ 157{
156 ide_hwif_t *hwif = HWIF(drive); 158 ide_hwif_t *hwif = HWIF(drive);
@@ -173,12 +175,18 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
173 switch (task->data_phase) { 175 switch (task->data_phase) {
174 case TASKFILE_MULTI_OUT: 176 case TASKFILE_MULTI_OUT:
175 case TASKFILE_OUT: 177 case TASKFILE_OUT:
178 task->handler = task_out_intr;
176 hwif->OUTBSYNC(drive, tf->command, IDE_COMMAND_REG); 179 hwif->OUTBSYNC(drive, tf->command, IDE_COMMAND_REG);
177 ndelay(400); /* FIXME */ 180 ndelay(400); /* FIXME */
178 return pre_task_out_intr(drive, task->rq); 181 return pre_task_out_intr(drive, task->rq);
179 case TASKFILE_MULTI_IN: 182 case TASKFILE_MULTI_IN:
180 case TASKFILE_IN: 183 case TASKFILE_IN:
184 task->handler = task_in_intr;
185 /* fall-through */
181 case TASKFILE_NO_DATA: 186 case TASKFILE_NO_DATA:
187 /* WIN_{SPECIFY,RESTORE,SETMULT} use custom handlers */
188 if (task->handler == NULL)
189 task->handler = task_no_data_intr;
182 ide_execute_command(drive, tf->command, task->handler, WAIT_WORSTCASE, NULL); 190 ide_execute_command(drive, tf->command, task->handler, WAIT_WORSTCASE, NULL);
183 return ide_started; 191 return ide_started;
184 default: 192 default:
@@ -248,7 +256,7 @@ ide_startstop_t recal_intr (ide_drive_t *drive)
248/* 256/*
249 * Handler for commands without a data phase 257 * Handler for commands without a data phase
250 */ 258 */
251ide_startstop_t task_no_data_intr (ide_drive_t *drive) 259static ide_startstop_t task_no_data_intr(ide_drive_t *drive)
252{ 260{
253 ide_task_t *args = HWGROUP(drive)->rq->special; 261 ide_task_t *args = HWGROUP(drive)->rq->special;
254 ide_hwif_t *hwif = HWIF(drive); 262 ide_hwif_t *hwif = HWIF(drive);
@@ -544,7 +552,6 @@ EXPORT_SYMBOL(ide_raw_taskfile);
544int ide_no_data_taskfile(ide_drive_t *drive, ide_task_t *task) 552int ide_no_data_taskfile(ide_drive_t *drive, ide_task_t *task)
545{ 553{
546 task->data_phase = TASKFILE_NO_DATA; 554 task->data_phase = TASKFILE_NO_DATA;
547 task->handler = task_no_data_intr;
548 555
549 return ide_raw_taskfile(drive, task, NULL, 0); 556 return ide_raw_taskfile(drive, task, NULL, 0);
550} 557}
@@ -667,7 +674,6 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
667 } 674 }
668 /* fall through */ 675 /* fall through */
669 case TASKFILE_OUT: 676 case TASKFILE_OUT:
670 args.handler = &task_out_intr;
671 /* fall through */ 677 /* fall through */
672 case TASKFILE_OUT_DMAQ: 678 case TASKFILE_OUT_DMAQ:
673 case TASKFILE_OUT_DMA: 679 case TASKFILE_OUT_DMA:
@@ -685,7 +691,6 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
685 } 691 }
686 /* fall through */ 692 /* fall through */
687 case TASKFILE_IN: 693 case TASKFILE_IN:
688 args.handler = &task_in_intr;
689 /* fall through */ 694 /* fall through */
690 case TASKFILE_IN_DMAQ: 695 case TASKFILE_IN_DMAQ:
691 case TASKFILE_IN_DMA: 696 case TASKFILE_IN_DMA:
@@ -693,7 +698,6 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
693 data_buf = inbuf; 698 data_buf = inbuf;
694 break; 699 break;
695 case TASKFILE_NO_DATA: 700 case TASKFILE_NO_DATA:
696 args.handler = &task_no_data_intr;
697 break; 701 break;
698 default: 702 default:
699 err = -EFAULT; 703 err = -EFAULT;