Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dfb2311226539e0496c0a7c65ceebaaff2120a0b
Commit:     dfb2311226539e0496c0a7c65ceebaaff2120a0b
Parent:     b9d9e61abb85ecf4e4aa55328b21eac17840a3fb
Author:     Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 13 17:47:52 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Oct 13 17:47:52 2007 +0200

    cs5520: fix ->dma_base equal zero handling
    
    Set hwif->ide_dma_{check,on} and hwif->autodma to 1 after checking that
    ->dma_base exists.  If ->dma_base is not set (== PCI BAR4 cannot be 
reserved)
    then DMA hooks shouldn't be initialized or bad things will happen.
    
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/cs5520.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
index cb2a102..fbce900 100644
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -142,25 +142,24 @@ static void __devinit init_hwif_cs5520(ide_hwif_t *hwif)
 {
        hwif->set_pio_mode = &cs5520_set_pio_mode;
        hwif->set_dma_mode = &cs5520_set_dma_mode;
-       hwif->ide_dma_check = &cs5520_config_drive_xfer_rate;
-       hwif->ide_dma_on = &cs5520_dma_on;
 
-       if(!noautodma)
-               hwif->autodma = 1;
-       
-       if(!hwif->dma_base)
-       {
-               hwif->drives[0].autotune = 1;
-               hwif->drives[1].autotune = 1;
+       if (hwif->dma_base == 0) {
+               hwif->drives[1].autotune = hwif->drives[0].autotune = 1;
                return;
        }
 
+       hwif->ide_dma_check = &cs5520_config_drive_xfer_rate;
+       hwif->ide_dma_on = &cs5520_dma_on;
+
        /* ATAPI is harder so leave it for now */
        hwif->atapi_dma = 0;
        hwif->ultra_mask = 0;
        hwif->swdma_mask = 0;
        hwif->mwdma_mask = 0;
-       
+
+       if (!noautodma)
+               hwif->autodma = 1;
+
        hwif->drives[0].autodma = hwif->autodma;
        hwif->drives[1].autodma = hwif->autodma;
 }
-
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