diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:26 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:26 -0400 |
commit | 7616c0ad2087c7d244b8985390c63059a6223c45 (patch) | |
tree | c65d7e5dce8b6ec314b56ad2903c8760e2659753 /drivers/ide/ide-tape.c | |
parent | 3ad6776cca21f2456b7288f44f224b344ac3c4d0 (diff) |
ide: add ide_atapi_{discard_data,write_zeros} inline helpers
Add ide_atapi_{discard_data,write_zeros} inline helpers to <linux/ide.h>
and use them instead of home-brewn helpers in ide-{floppy,tape,scsi}.
There should be no functional changes caused by this patch.
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r-- | drivers/ide/ide-tape.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 0598ecfd5f37..bfdc4f449797 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -518,16 +518,6 @@ static struct ide_tape_obj *ide_tape_chrdev_get(unsigned int i) | |||
518 | return tape; | 518 | return tape; |
519 | } | 519 | } |
520 | 520 | ||
521 | /* | ||
522 | * Too bad. The drive wants to send us data which we are not ready to accept. | ||
523 | * Just throw it away. | ||
524 | */ | ||
525 | static void idetape_discard_data(ide_drive_t *drive, unsigned int bcount) | ||
526 | { | ||
527 | while (bcount--) | ||
528 | (void) HWIF(drive)->INB(IDE_DATA_REG); | ||
529 | } | ||
530 | |||
531 | static void idetape_input_buffers(ide_drive_t *drive, idetape_pc_t *pc, | 521 | static void idetape_input_buffers(ide_drive_t *drive, idetape_pc_t *pc, |
532 | unsigned int bcount) | 522 | unsigned int bcount) |
533 | { | 523 | { |
@@ -538,7 +528,7 @@ static void idetape_input_buffers(ide_drive_t *drive, idetape_pc_t *pc, | |||
538 | if (bh == NULL) { | 528 | if (bh == NULL) { |
539 | printk(KERN_ERR "ide-tape: bh == NULL in " | 529 | printk(KERN_ERR "ide-tape: bh == NULL in " |
540 | "idetape_input_buffers\n"); | 530 | "idetape_input_buffers\n"); |
541 | idetape_discard_data(drive, bcount); | 531 | ide_atapi_discard_data(drive, bcount); |
542 | return; | 532 | return; |
543 | } | 533 | } |
544 | count = min( | 534 | count = min( |
@@ -1152,7 +1142,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) | |||
1152 | printk(KERN_ERR "ide-tape: The tape wants to " | 1142 | printk(KERN_ERR "ide-tape: The tape wants to " |
1153 | "send us more data than expected " | 1143 | "send us more data than expected " |
1154 | "- discarding data\n"); | 1144 | "- discarding data\n"); |
1155 | idetape_discard_data(drive, bcount); | 1145 | ide_atapi_discard_data(drive, bcount); |
1156 | ide_set_handler(drive, &idetape_pc_intr, | 1146 | ide_set_handler(drive, &idetape_pc_intr, |
1157 | IDETAPE_WAIT_CMD, NULL); | 1147 | IDETAPE_WAIT_CMD, NULL); |
1158 | return ide_started; | 1148 | return ide_started; |