Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7b905994ce0bd332afc5ebc30ce9afa60d23c6e2
Commit:     7b905994ce0bd332afc5ebc30ce9afa60d23c6e2
Parent:     23b1bd459c9e8a925381960f0b69ac85468c3af1
Author:     Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 25 22:17:19 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Fri Jan 25 22:17:19 2008 +0100

    ide: cleanup ide_set_dma()
    
    * ->dma_off_quietly is always called before ide_set_dma()
      so the call can be moved inside ide_set_dma().
    
    * ide_dma_check() doesn't touch hardware so ->dma_off_quietly
      call for 'rc == -1' case is redundant, remove it.
    
    * '0' and '-1' are the only values returned by ide_dma_check()
      so remove dead code for other cases.
    
    There should be no functionality changes caused by this patch.
    
    Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-dma.c   |   25 +++++++++++--------------
 drivers/ide/ide-io.c    |    1 -
 drivers/ide/ide-probe.c |   10 +---------
 drivers/ide/ide.c       |    1 -
 4 files changed, 12 insertions(+), 25 deletions(-)

diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 7568c3e..0103630 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -827,22 +827,19 @@ int ide_set_dma(ide_drive_t *drive)
        ide_hwif_t *hwif = drive->hwif;
        int rc;
 
-       rc = ide_dma_check(drive);
+       /*
+        * Force DMAing for the beginning of the check.
+        * Some chipsets appear to do interesting
+        * things, if not checked and cleared.
+        *   PARANOIA!!!
+        */
+       hwif->dma_off_quietly(drive);
 
-       switch(rc) {
-       case -1: /* DMA needs to be disabled */
-               hwif->dma_off_quietly(drive);
-               return -1;
-       case  0: /* DMA needs to be enabled */
-               return hwif->ide_dma_on(drive);
-       case  1: /* DMA setting cannot be changed */
-               break;
-       default:
-               BUG();
-               break;
-       }
+       rc = ide_dma_check(drive);
+       if (rc)
+               return rc;
 
-       return rc;
+       return hwif->ide_dma_on(drive);
 }
 
 #ifdef CONFIG_BLK_DEV_IDEDMA_PCI
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index e053e00..2711b5a 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -221,7 +221,6 @@ static ide_startstop_t ide_start_power_step(ide_drive_t 
*drive, struct request *
                 */
                if (drive->hwif->ide_dma_on == NULL)
                        break;
-               drive->hwif->dma_off_quietly(drive);
                /*
                 * TODO: respect ->using_dma setting
                 */
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 33e62d2..0379d1f 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -833,16 +833,8 @@ static void probe_hwif(ide_hwif_t *hwif)
 
                        drive->nice1 = 1;
 
-                       if (hwif->ide_dma_on) {
-                               /*
-                                * Force DMAing for the beginning of the check.
-                                * Some chipsets appear to do interesting
-                                * things, if not checked and cleared.
-                                *   PARANOIA!!!
-                                */
-                               hwif->dma_off_quietly(drive);
+                       if (hwif->ide_dma_on)
                                ide_set_dma(drive);
-                       }
                }
        }
 
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 00ef6ec..c6d4f63 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -851,7 +851,6 @@ int set_using_dma(ide_drive_t *drive, int arg)
        err = 0;
 
        if (arg) {
-               hwif->dma_off_quietly(drive);
                if (ide_set_dma(drive))
                        err = -EIO;
        } else
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to