diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:32 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:32 -0400 |
commit | e3d9a73a83d98fc466dabdcfe4f4e7e4419e3f8e (patch) | |
tree | 3a93a8eca3800bafe5aeaf6a469fb3af05739c44 /drivers | |
parent | 5e76acd588c125fbd37390e44868dcb07cadbe4a (diff) |
ide: remove ->data_phase field from ide_hwif_t
* Always use hwif->task->data_phase and remove ->data_phase
field from ide_hwif_t.
* Remove superfluous REQ_TYPE_ATA_TASKFILE check from
ide_pio_datablock() while at it.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/ide-disk.c | 3 | ||||
-rw-r--r-- | drivers/ide/ide-io.c | 5 | ||||
-rw-r--r-- | drivers/ide/ide-park.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-taskfile.c | 18 |
4 files changed, 10 insertions, 18 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 806760d24cef..0f196e5fcff3 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -160,8 +160,6 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, | |||
160 | task.tf_flags |= IDE_TFLAG_WRITE; | 160 | task.tf_flags |= IDE_TFLAG_WRITE; |
161 | 161 | ||
162 | ide_tf_set_cmd(drive, &task, dma); | 162 | ide_tf_set_cmd(drive, &task, dma); |
163 | if (!dma) | ||
164 | hwif->data_phase = task.data_phase; | ||
165 | task.rq = rq; | 163 | task.rq = rq; |
166 | 164 | ||
167 | rc = do_rw_taskfile(drive, &task); | 165 | rc = do_rw_taskfile(drive, &task); |
@@ -170,7 +168,6 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, | |||
170 | /* fallback to PIO */ | 168 | /* fallback to PIO */ |
171 | task.tf_flags |= IDE_TFLAG_DMA_PIO_FALLBACK; | 169 | task.tf_flags |= IDE_TFLAG_DMA_PIO_FALLBACK; |
172 | ide_tf_set_cmd(drive, &task, 0); | 170 | ide_tf_set_cmd(drive, &task, 0); |
173 | hwif->data_phase = task.data_phase; | ||
174 | ide_init_sg_cmd(drive, rq); | 171 | ide_init_sg_cmd(drive, rq); |
175 | rc = do_rw_taskfile(drive, &task); | 172 | rc = do_rw_taskfile(drive, &task); |
176 | } | 173 | } |
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 45fc18ff73cb..38076169b893 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -310,13 +310,10 @@ EXPORT_SYMBOL_GPL(ide_init_sg_cmd); | |||
310 | static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, | 310 | static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, |
311 | struct request *rq) | 311 | struct request *rq) |
312 | { | 312 | { |
313 | ide_hwif_t *hwif = drive->hwif; | ||
314 | ide_task_t *task = rq->special; | 313 | ide_task_t *task = rq->special; |
315 | 314 | ||
316 | if (task) { | 315 | if (task) { |
317 | hwif->data_phase = task->data_phase; | 316 | switch (task->data_phase) { |
318 | |||
319 | switch (hwif->data_phase) { | ||
320 | case TASKFILE_MULTI_OUT: | 317 | case TASKFILE_MULTI_OUT: |
321 | case TASKFILE_OUT: | 318 | case TASKFILE_OUT: |
322 | case TASKFILE_MULTI_IN: | 319 | case TASKFILE_MULTI_IN: |
diff --git a/drivers/ide/ide-park.c b/drivers/ide/ide-park.c index f30e52152fcb..cddc7c778760 100644 --- a/drivers/ide/ide-park.c +++ b/drivers/ide/ide-park.c | |||
@@ -81,7 +81,7 @@ ide_startstop_t ide_do_park_unpark(ide_drive_t *drive, struct request *rq) | |||
81 | 81 | ||
82 | task.tf_flags |= IDE_TFLAG_TF | IDE_TFLAG_DEVICE; | 82 | task.tf_flags |= IDE_TFLAG_TF | IDE_TFLAG_DEVICE; |
83 | task.rq = rq; | 83 | task.rq = rq; |
84 | drive->hwif->data_phase = task.data_phase = TASKFILE_NO_DATA; | 84 | task.data_phase = TASKFILE_NO_DATA; |
85 | return do_rw_taskfile(drive, &task); | 85 | return do_rw_taskfile(drive, &task); |
86 | } | 86 | } |
87 | 87 | ||
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 297cf6f4c723..7237e1547b1f 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -265,21 +265,18 @@ static void ide_pio_multi(ide_drive_t *drive, struct request *rq, | |||
265 | static void ide_pio_datablock(ide_drive_t *drive, struct request *rq, | 265 | static void ide_pio_datablock(ide_drive_t *drive, struct request *rq, |
266 | unsigned int write) | 266 | unsigned int write) |
267 | { | 267 | { |
268 | ide_task_t *task = &drive->hwif->task; | ||
268 | u8 saved_io_32bit = drive->io_32bit; | 269 | u8 saved_io_32bit = drive->io_32bit; |
269 | 270 | ||
270 | if (rq->bio) /* fs request */ | 271 | if (rq->bio) /* fs request */ |
271 | rq->errors = 0; | 272 | rq->errors = 0; |
272 | 273 | ||
273 | if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { | 274 | if (task->tf_flags & IDE_TFLAG_IO_16BIT) |
274 | ide_task_t *task = rq->special; | 275 | drive->io_32bit = 0; |
275 | |||
276 | if (task->tf_flags & IDE_TFLAG_IO_16BIT) | ||
277 | drive->io_32bit = 0; | ||
278 | } | ||
279 | 276 | ||
280 | touch_softlockup_watchdog(); | 277 | touch_softlockup_watchdog(); |
281 | 278 | ||
282 | switch (drive->hwif->data_phase) { | 279 | switch (task->data_phase) { |
283 | case TASKFILE_MULTI_IN: | 280 | case TASKFILE_MULTI_IN: |
284 | case TASKFILE_MULTI_OUT: | 281 | case TASKFILE_MULTI_OUT: |
285 | ide_pio_multi(drive, rq, write); | 282 | ide_pio_multi(drive, rq, write); |
@@ -297,9 +294,10 @@ static ide_startstop_t task_error(ide_drive_t *drive, struct request *rq, | |||
297 | { | 294 | { |
298 | if (rq->bio) { | 295 | if (rq->bio) { |
299 | ide_hwif_t *hwif = drive->hwif; | 296 | ide_hwif_t *hwif = drive->hwif; |
297 | ide_task_t *task = &hwif->task; | ||
300 | int sectors = hwif->nsect - hwif->nleft; | 298 | int sectors = hwif->nsect - hwif->nleft; |
301 | 299 | ||
302 | switch (hwif->data_phase) { | 300 | switch (task->data_phase) { |
303 | case TASKFILE_IN: | 301 | case TASKFILE_IN: |
304 | if (hwif->nleft) | 302 | if (hwif->nleft) |
305 | break; | 303 | break; |
@@ -431,14 +429,14 @@ static ide_startstop_t task_out_intr (ide_drive_t *drive) | |||
431 | 429 | ||
432 | static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq) | 430 | static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq) |
433 | { | 431 | { |
434 | ide_hwif_t *hwif = drive->hwif; | 432 | ide_task_t *task = &drive->hwif->task; |
435 | ide_startstop_t startstop; | 433 | ide_startstop_t startstop; |
436 | 434 | ||
437 | if (ide_wait_stat(&startstop, drive, ATA_DRQ, | 435 | if (ide_wait_stat(&startstop, drive, ATA_DRQ, |
438 | drive->bad_wstat, WAIT_DRQ)) { | 436 | drive->bad_wstat, WAIT_DRQ)) { |
439 | printk(KERN_ERR "%s: no DRQ after issuing %sWRITE%s\n", | 437 | printk(KERN_ERR "%s: no DRQ after issuing %sWRITE%s\n", |
440 | drive->name, | 438 | drive->name, |
441 | hwif->data_phase == TASKFILE_MULTI_OUT ? "MULT" : "", | 439 | task->data_phase == TASKFILE_MULTI_OUT ? "MULT" : "", |
442 | (drive->dev_flags & IDE_DFLAG_LBA48) ? "_EXT" : ""); | 440 | (drive->dev_flags & IDE_DFLAG_LBA48) ? "_EXT" : ""); |
443 | return startstop; | 441 | return startstop; |
444 | } | 442 | } |