]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ide: remove try_to_flush_leftover_data()
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 15 Jul 2008 19:21:47 +0000 (21:21 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 15 Jul 2008 19:21:47 +0000 (21:21 +0200)
Just use the new & shiny ide_pad_transfer() helper instead.

Also remove the superfluous check for 'drive->media == ide_disk'
while at it (ide_ata_error() is used only for ide_disk devices).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-io.c

index d8b4d9f81ae291a50760123f7d6068896c35662c..c22a337ced4eaf1b9b42e9f1bdcfca6dae6ef289 100644 (file)
@@ -358,31 +358,6 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
 
 EXPORT_SYMBOL(ide_end_drive_cmd);
 
-/**
- *     try_to_flush_leftover_data      -       flush junk
- *     @drive: drive to flush
- *
- *     try_to_flush_leftover_data() is invoked in response to a drive
- *     unexpectedly having its DRQ_STAT bit set.  As an alternative to
- *     resetting the drive, this routine tries to clear the condition
- *     by read a sector's worth of data from the drive.  Of course,
- *     this may not help if the drive is *waiting* for data from *us*.
- */
-static void try_to_flush_leftover_data (ide_drive_t *drive)
-{
-       int i = (drive->mult_count ? drive->mult_count : 1) * SECTOR_WORDS;
-
-       if (drive->media != ide_disk)
-               return;
-       while (i > 0) {
-               u32 buffer[16];
-               u32 wcount = (i > 16) ? 16 : i;
-
-               i -= wcount;
-               drive->hwif->input_data(drive, NULL, buffer, wcount * 4);
-       }
-}
-
 static void ide_kill_rq(ide_drive_t *drive, struct request *rq)
 {
        if (rq->rq_disk) {
@@ -422,8 +397,11 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8
        }
 
        if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ &&
-           (hwif->host_flags & IDE_HFLAG_ERROR_STOPS_FIFO) == 0)
-               try_to_flush_leftover_data(drive);
+           (hwif->host_flags & IDE_HFLAG_ERROR_STOPS_FIFO) == 0) {
+               int nsect = drive->mult_count ? drive->mult_count : 1;
+
+               ide_pad_transfer(drive, READ, nsect * SECTOR_SIZE);
+       }
 
        if (rq->errors >= ERROR_MAX || blk_noretry_request(rq)) {
                ide_kill_rq(drive, rq);