[PATCH] SLC90E66: config_drive_for_dma() cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

   Clean up config_drive_for_dma() from the useless code as there's no need
for PIO fallback here since this is done by its caller,
slc90e66_config_drive_xfer_rate().
   Also, while at it, simplify slc90e66_config_drive_xfer_rate() a bit.

MBR, Sergei

Signed-off-by: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>

Index: linus/drivers/ide/pci/slc90e66.c
===================================================================
--- linus.orig/drivers/ide/pci/slc90e66.c
+++ linus/drivers/ide/pci/slc90e66.c
@@ -2,6 +2,7 @@
  *  linux/drivers/ide/pci/slc90e66.c	Version 0.11	September 11, 2002
  *
  *  Copyright (C) 2000-2002 Andre Hedrick <andre@xxxxxxxxxxxxx>
+ *  Copyright (C) 2006 MontaVista Software, Inc. <source@xxxxxxxxxx>
  *
  * This a look-a-like variation of the ICH0 PIIX4 Ultra-66,
  * but this keeps the ISA-Bridge and slots alive.
@@ -161,10 +162,8 @@ static int slc90e66_config_drive_for_dma
 {
 	u8 speed = ide_dma_speed(drive, slc90e66_ratemask(drive));
 
-	if (!(speed)) {
-		u8 tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL);
-		speed = slc90e66_dma_2_pio(XFER_PIO_0 + tspeed);
-	}
+	if (!speed)
+		return 0;
 
 	(void) slc90e66_tune_chipset(drive, speed);
 	return ide_dma_enable(drive);
@@ -179,10 +178,8 @@ static int slc90e66_config_drive_xfer_ra
 
 	if (id && (id->capability & 1) && drive->autodma) {
 
-		if (ide_use_dma(drive)) {
-			if (slc90e66_config_drive_for_dma(drive))
-				return hwif->ide_dma_on(drive);
-		}
+		if (ide_use_dma(drive) && slc90e66_config_drive_for_dma(drive))
+			return hwif->ide_dma_on(drive);
 
 		goto fast_ata_pio;
 


[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux