aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-04-18 19:46:03 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-04-28 01:37:32 -0400
commit29d1a4371035e01b0d079bc5aa88b50f5af7a566 (patch)
tree4aad5a0868e1929f0ced33ffde34b334760c0522
parent4344d07fb8dbf0cbfec1f7d7c1afeccaceaaa120 (diff)
ide-atapi: kill unused fields and callbacks
Impact: remove fields and code paths which are no longer necessary Now that ide-tape uses standard mechanisms to transfer data, special case handling for bh handling can be dropped from ide-atapi. Drop the followings. * pc->cur_pos, b_count, bh and b_data * drive->pc_update_buffers() and pc_io_buffers(). Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--drivers/ide/ide-atapi.c17
-rw-r--r--drivers/ide/ide-tape.c1
-rw-r--r--include/linux/ide.h12
3 files changed, 4 insertions, 26 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index b9dd4503cbc7..afe5a4323879 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -359,11 +359,8 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
359 drive->name, rq_data_dir(pc->rq) 359 drive->name, rq_data_dir(pc->rq)
360 ? "write" : "read"); 360 ? "write" : "read");
361 pc->flags |= PC_FLAG_DMA_ERROR; 361 pc->flags |= PC_FLAG_DMA_ERROR;
362 } else { 362 } else
363 pc->xferred = pc->req_xfer; 363 pc->xferred = pc->req_xfer;
364 if (drive->pc_update_buffers)
365 drive->pc_update_buffers(drive, pc);
366 }
367 debug_log("%s: DMA finished\n", drive->name); 364 debug_log("%s: DMA finished\n", drive->name);
368 } 365 }
369 366
@@ -463,16 +460,11 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
463 return ide_do_reset(drive); 460 return ide_do_reset(drive);
464 } 461 }
465 462
466 if (drive->media == ide_tape && pc->bh) 463 done = min_t(unsigned int, bcount, cmd->nleft);
467 done = drive->pc_io_buffers(drive, pc, bcount, write); 464 ide_pio_bytes(drive, cmd, write, done);
468 else {
469 done = min_t(unsigned int, bcount, cmd->nleft);
470 ide_pio_bytes(drive, cmd, write, done);
471 }
472 465
473 /* Update the current position */ 466 /* Update transferred byte count */
474 pc->xferred += done; 467 pc->xferred += done;
475 pc->cur_pos += done;
476 468
477 bcount -= done; 469 bcount -= done;
478 470
@@ -650,7 +642,6 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd)
650 642
651 /* We haven't transferred any data yet */ 643 /* We haven't transferred any data yet */
652 pc->xferred = 0; 644 pc->xferred = 0;
653 pc->cur_pos = pc->buf;
654 645
655 valid_tf = IDE_VALID_DEVICE; 646 valid_tf = IDE_VALID_DEVICE;
656 bcount = ((drive->media == ide_tape) ? 647 bcount = ((drive->media == ide_tape) ?
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 2599579e4174..8dfc68892d6a 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -591,7 +591,6 @@ static void ide_tape_create_rw_cmd(idetape_tape_t *tape,
591 ide_init_pc(pc); 591 ide_init_pc(pc);
592 put_unaligned(cpu_to_be32(length), (unsigned int *) &pc->c[1]); 592 put_unaligned(cpu_to_be32(length), (unsigned int *) &pc->c[1]);
593 pc->c[1] = 1; 593 pc->c[1] = 1;
594 pc->bh = NULL;
595 pc->buf = NULL; 594 pc->buf = NULL;
596 pc->buf_size = length * tape->blk_size; 595 pc->buf_size = length * tape->blk_size;
597 pc->req_xfer = pc->buf_size; 596 pc->req_xfer = pc->buf_size;
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 1957461ac762..34c128f0a33c 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -362,11 +362,7 @@ struct ide_atapi_pc {
362 362
363 /* data buffer */ 363 /* data buffer */
364 u8 *buf; 364 u8 *buf;
365 /* current buffer position */
366 u8 *cur_pos;
367 int buf_size; 365 int buf_size;
368 /* missing/available data on the current buffer */
369 int b_count;
370 366
371 /* the corresponding request */ 367 /* the corresponding request */
372 struct request *rq; 368 struct request *rq;
@@ -379,10 +375,6 @@ struct ide_atapi_pc {
379 */ 375 */
380 u8 pc_buf[IDE_PC_BUFFER_SIZE]; 376 u8 pc_buf[IDE_PC_BUFFER_SIZE];
381 377
382 /* idetape only */
383 struct idetape_bh *bh;
384 char *b_data;
385
386 unsigned long timeout; 378 unsigned long timeout;
387}; 379};
388 380
@@ -595,10 +587,6 @@ struct ide_drive_s {
595 /* callback for packet commands */ 587 /* callback for packet commands */
596 int (*pc_callback)(struct ide_drive_s *, int); 588 int (*pc_callback)(struct ide_drive_s *, int);
597 589
598 void (*pc_update_buffers)(struct ide_drive_s *, struct ide_atapi_pc *);
599 int (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *,
600 unsigned int, int);
601
602 ide_startstop_t (*irq_handler)(struct ide_drive_s *); 590 ide_startstop_t (*irq_handler)(struct ide_drive_s *);
603 591
604 unsigned long atapi_flags; 592 unsigned long atapi_flags;