* [PATCH] SLC90E66: config_drive_for_dma() cleanup
@ 2006-05-11 19:38 Sergei Shtylyov
0 siblings, 0 replies; only message in thread
From: Sergei Shtylyov @ 2006-05-11 19:38 UTC (permalink / raw)
To: Andrew Morton; +Cc: Bartlomiej Zolnierkiewicz, Alan Cox, linux-ide
[-- Attachment #1: Type: text/plain, Size: 321 bytes --]
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@ru.mvista.com>
[-- Attachment #2: slc90e66-config_drive_for_dma-cleanup.patch --]
[-- Type: text/plain, Size: 1263 bytes --]
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@linux-ide.org>
+ * Copyright (C) 2006 MontaVista Software, Inc. <source@mvista.com>
*
* 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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-05-11 19:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-11 19:38 [PATCH] SLC90E66: config_drive_for_dma() cleanup Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).