]> err.no Git - linux-2.6/commitdiff
[PATCH] it821x: fix ide dma setup bug
authorJens Axboe <axboe@suse.de>
Fri, 28 Jul 2006 07:02:17 +0000 (09:02 +0200)
committerJens Axboe <axboe@suse.de>
Fri, 28 Jul 2006 07:02:17 +0000 (09:02 +0200)
Only enable dma for a valid speed setting.

Signed-off-by: Jens Axboe <axboe@suse.de>
drivers/ide/pci/it821x.c

index 3cb04424d351dcb9f88e0163a120ea103983b19c..e9bad185968a8e289cd28f2844ac2578b6727373 100644 (file)
@@ -498,9 +498,14 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 {
        u8 speed        = ide_dma_speed(drive, it821x_ratemask(drive));
 
-       config_it821x_chipset_for_pio(drive, !speed);
-       it821x_tune_chipset(drive, speed);
-       return ide_dma_enable(drive);
+       if (speed) {
+               config_it821x_chipset_for_pio(drive, 0);
+               it821x_tune_chipset(drive, speed);
+
+               return ide_dma_enable(drive);
+       }
+
+       return 0;
 }
 
 /**