aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-02 13:56:47 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-02 13:56:47 -0500
commit296921a4ca01612cb1d9a43343b33a33eb7697ff (patch)
treec45dd1c7807b2ef68b91fd7799667bcd56c8e501 /drivers
parent99ffbe0e9713c89798c90bde7a462645e098b76b (diff)
ide: remove ide_auto_reduce_xfer()
While at it: * Remove needless '!drive->crc_count' check. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide-iops.c41
1 files changed, 13 insertions, 28 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 955bac2166a2..b7da44c9e91c 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -612,33 +612,6 @@ no_80w:
612 return 0; 612 return 0;
613} 613}
614 614
615#ifdef CONFIG_BLK_DEV_IDEDMA
616static u8 ide_auto_reduce_xfer (ide_drive_t *drive)
617{
618 if (!drive->crc_count)
619 return drive->current_speed;
620 drive->crc_count = 0;
621
622 switch(drive->current_speed) {
623 case XFER_UDMA_7: return XFER_UDMA_6;
624 case XFER_UDMA_6: return XFER_UDMA_5;
625 case XFER_UDMA_5: return XFER_UDMA_4;
626 case XFER_UDMA_4: return XFER_UDMA_3;
627 case XFER_UDMA_3: return XFER_UDMA_2;
628 case XFER_UDMA_2: return XFER_UDMA_1;
629 case XFER_UDMA_1: return XFER_UDMA_0;
630 /*
631 * OOPS we do not goto non Ultra DMA modes
632 * without iCRC's available we force
633 * the system to PIO and make the user
634 * invoke the ATA-1 ATA-2 DMA modes.
635 */
636 case XFER_UDMA_0:
637 default: return XFER_PIO_4;
638 }
639}
640#endif /* CONFIG_BLK_DEV_IDEDMA */
641
642int ide_driveid_update(ide_drive_t *drive) 615int ide_driveid_update(ide_drive_t *drive)
643{ 616{
644 ide_hwif_t *hwif = drive->hwif; 617 ide_hwif_t *hwif = drive->hwif;
@@ -968,8 +941,20 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive)
968static void check_dma_crc(ide_drive_t *drive) 941static void check_dma_crc(ide_drive_t *drive)
969{ 942{
970#ifdef CONFIG_BLK_DEV_IDEDMA 943#ifdef CONFIG_BLK_DEV_IDEDMA
944 u8 mode;
945
971 ide_dma_off_quietly(drive); 946 ide_dma_off_quietly(drive);
972 ide_set_xfer_rate(drive, ide_auto_reduce_xfer(drive)); 947 drive->crc_count = 0;
948 mode = drive->current_speed;
949 /*
950 * Don't try non Ultra-DMA modes without iCRC's. Force the
951 * device to PIO and make the user enable SWDMA/MWDMA modes.
952 */
953 if (mode > XFER_UDMA_0 && mode <= XFER_UDMA_7)
954 mode--;
955 else
956 mode = XFER_PIO_4;
957 ide_set_xfer_rate(drive, mode);
973 if (drive->current_speed >= XFER_SW_DMA_0) 958 if (drive->current_speed >= XFER_SW_DMA_0)
974 ide_dma_on(drive); 959 ide_dma_on(drive);
975#endif 960#endif