diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:15 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:15 -0500 |
commit | 1edee60e9d994f2b9a79b1333be39790683541fe (patch) | |
tree | f180358d478d5f9366267afd8c9ff2104a2cb930 /drivers/ide/ide-taskfile.c | |
parent | a7bbd20b50fb12b3a604c396b3d8a3449a43edcc (diff) |
ide: merge flagged_taskfile() into do_rw_taskfile()
Based on the earlier work by Tejun Heo.
task->data_phase == TASKFILE_MULTI_{IN,OUT} vs drive->mult_count == 0
check is needed also for ide_taskfile_ioctl() requests that don't have
IDE_TFLAG_FLAGGED taskfile flag set.
Cc: Tejun Heo <htejun@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r-- | drivers/ide/ide-taskfile.c | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 03c4a0c55bf4..1a34edb183ec 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -156,6 +156,18 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task) | |||
156 | ide_hwif_t *hwif = HWIF(drive); | 156 | ide_hwif_t *hwif = HWIF(drive); |
157 | struct ide_taskfile *tf = &task->tf; | 157 | struct ide_taskfile *tf = &task->tf; |
158 | 158 | ||
159 | if (task->data_phase == TASKFILE_MULTI_IN || | ||
160 | task->data_phase == TASKFILE_MULTI_OUT) { | ||
161 | if (!drive->mult_count) { | ||
162 | printk(KERN_ERR "%s: multimode not set!\n", | ||
163 | drive->name); | ||
164 | return ide_stopped; | ||
165 | } | ||
166 | } | ||
167 | |||
168 | if (task->tf_flags & IDE_TFLAG_FLAGGED) | ||
169 | task->tf_flags |= IDE_TFLAG_FLAGGED_SET_IN_FLAGS; | ||
170 | |||
159 | ide_tf_load(drive, task); | 171 | ide_tf_load(drive, task); |
160 | 172 | ||
161 | if (task->handler != NULL) { | 173 | if (task->handler != NULL) { |
@@ -839,23 +851,3 @@ int ide_task_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) | |||
839 | 851 | ||
840 | return err; | 852 | return err; |
841 | } | 853 | } |
842 | |||
843 | /* | ||
844 | * NOTICE: This is additions from IBM to provide a discrete interface, | ||
845 | * for selective taskregister access operations. Nice JOB Klaus!!! | ||
846 | * Glad to be able to work and co-develop this with you and IBM. | ||
847 | */ | ||
848 | ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task) | ||
849 | { | ||
850 | if (task->data_phase == TASKFILE_MULTI_IN || | ||
851 | task->data_phase == TASKFILE_MULTI_OUT) { | ||
852 | if (!drive->mult_count) { | ||
853 | printk(KERN_ERR "%s: multimode not set!\n", drive->name); | ||
854 | return ide_stopped; | ||
855 | } | ||
856 | } | ||
857 | |||
858 | task->tf_flags |= IDE_TFLAG_FLAGGED_SET_IN_FLAGS; | ||
859 | |||
860 | return do_rw_taskfile(drive, task); | ||
861 | } | ||