aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-tape.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-28 17:44:36 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-28 17:44:36 -0400
commit9567b349f7e7dd7e2483db99ee8e4a6fe0caca38 (patch)
tree29abab829b52a451567f8da4280d101fafa44527 /drivers/ide/ide-tape.c
parent92d3ab27e8fd23d1a9dc3b69d17b2afb83e5c6f5 (diff)
ide: merge ->atapi_*put_bytes and ->ata_*put_data methods
* Merge ->atapi_{in,out}put_bytes and ->ata_{in,out}put_data methods into new ->{in,out}put_data methods which take number of bytes to transfer as an argument and always do padding. While at it: * Use 'hwif' or 'drive->hwif' instead of 'HWIF(drive)'. There should be no functional changes caused by this patch (all users of ->ata_{in,out}put_data methods were using multiply-of-4 word counts). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r--drivers/ide/ide-tape.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 29870c415110..f4f31238bbef 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -401,7 +401,7 @@ static void idetape_input_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc,
401 count = min( 401 count = min(
402 (unsigned int)(bh->b_size - atomic_read(&bh->b_count)), 402 (unsigned int)(bh->b_size - atomic_read(&bh->b_count)),
403 bcount); 403 bcount);
404 HWIF(drive)->atapi_input_bytes(drive, bh->b_data + 404 drive->hwif->input_data(drive, NULL, bh->b_data +
405 atomic_read(&bh->b_count), count); 405 atomic_read(&bh->b_count), count);
406 bcount -= count; 406 bcount -= count;
407 atomic_add(count, &bh->b_count); 407 atomic_add(count, &bh->b_count);
@@ -427,7 +427,7 @@ static void idetape_output_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc,
427 return; 427 return;
428 } 428 }
429 count = min((unsigned int)pc->b_count, (unsigned int)bcount); 429 count = min((unsigned int)pc->b_count, (unsigned int)bcount);
430 HWIF(drive)->atapi_output_bytes(drive, pc->b_data, count); 430 drive->hwif->output_data(drive, NULL, pc->b_data, count);
431 bcount -= count; 431 bcount -= count;
432 pc->b_data += count; 432 pc->b_data += count;
433 pc->b_count -= count; 433 pc->b_count -= count;
@@ -880,16 +880,16 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
880 "data than expected - allowing transfer\n"); 880 "data than expected - allowing transfer\n");
881 } 881 }
882 iobuf = &idetape_input_buffers; 882 iobuf = &idetape_input_buffers;
883 xferfunc = hwif->atapi_input_bytes; 883 xferfunc = hwif->input_data;
884 } else { 884 } else {
885 iobuf = &idetape_output_buffers; 885 iobuf = &idetape_output_buffers;
886 xferfunc = hwif->atapi_output_bytes; 886 xferfunc = hwif->output_data;
887 } 887 }
888 888
889 if (pc->bh) 889 if (pc->bh)
890 iobuf(drive, pc, bcount); 890 iobuf(drive, pc, bcount);
891 else 891 else
892 xferfunc(drive, pc->cur_pos, bcount); 892 xferfunc(drive, NULL, pc->cur_pos, bcount);
893 893
894 /* Update the current position */ 894 /* Update the current position */
895 pc->xferred += bcount; 895 pc->xferred += bcount;
@@ -979,7 +979,8 @@ static ide_startstop_t idetape_transfer_pc(ide_drive_t *drive)
979 hwif->dma_ops->dma_start(drive); 979 hwif->dma_ops->dma_start(drive);
980#endif 980#endif
981 /* Send the actual packet */ 981 /* Send the actual packet */
982 HWIF(drive)->atapi_output_bytes(drive, pc->c, 12); 982 hwif->output_data(drive, NULL, pc->c, 12);
983
983 return ide_started; 984 return ide_started;
984} 985}
985 986