aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-tape.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r--drivers/ide/ide-tape.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index b224823a8ae7..6801c68ee7da 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -780,7 +780,14 @@ static void ide_tape_handle_dsc(ide_drive_t *drive)
780 idetape_postpone_request(drive); 780 idetape_postpone_request(drive);
781} 781}
782 782
783typedef void idetape_io_buf(ide_drive_t *, struct ide_atapi_pc *, unsigned int); 783static void ide_tape_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc,
784 unsigned int bcount, int write)
785{
786 if (write)
787 idetape_output_buffers(drive, pc, bcount);
788 else
789 idetape_input_buffers(drive, pc, bcount);
790}
784 791
785/* 792/*
786 * This is the usual interrupt handler which will be called during a packet 793 * This is the usual interrupt handler which will be called during a packet
@@ -795,7 +802,6 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
795 idetape_tape_t *tape = drive->driver_data; 802 idetape_tape_t *tape = drive->driver_data;
796 struct ide_atapi_pc *pc = tape->pc; 803 struct ide_atapi_pc *pc = tape->pc;
797 xfer_func_t *xferfunc; 804 xfer_func_t *xferfunc;
798 idetape_io_buf *iobuf;
799 unsigned int temp; 805 unsigned int temp;
800 u16 bcount; 806 u16 bcount;
801 u8 stat, ireason; 807 u8 stat, ireason;
@@ -895,15 +901,14 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
895 debug_log(DBG_SENSE, "The device wants to send us more " 901 debug_log(DBG_SENSE, "The device wants to send us more "
896 "data than expected - allowing transfer\n"); 902 "data than expected - allowing transfer\n");
897 } 903 }
898 iobuf = &idetape_input_buffers;
899 xferfunc = hwif->input_data; 904 xferfunc = hwif->input_data;
900 } else { 905 } else {
901 iobuf = &idetape_output_buffers;
902 xferfunc = hwif->output_data; 906 xferfunc = hwif->output_data;
903 } 907 }
904 908
905 if (pc->bh) 909 if (pc->bh)
906 iobuf(drive, pc, bcount); 910 ide_tape_io_buffers(drive, pc, bcount,
911 !!(pc->flags & PC_FLAG_WRITING));
907 else 912 else
908 xferfunc(drive, NULL, pc->cur_pos, bcount); 913 xferfunc(drive, NULL, pc->cur_pos, bcount);
909 914