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

    sc1200: fix ->dma_base equal zero handling
    
    Set hwif->atapi_dma/{ultra,mwdma}_mask and drive->autodma 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.
    
    OTOH hwif->set_{pio,dma}_mode hooks should be set even if hwif->dma_base == 
0.
    
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/sc1200.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index 76f0868..ee0e3f5 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -378,16 +378,20 @@ static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif)
        if (hwif->mate)
                hwif->serialized = hwif->mate->serialized = 1;
        hwif->autodma = 0;
-       if (hwif->dma_base) {
-               hwif->udma_filter = sc1200_udma_filter;
-               hwif->ide_dma_check = &sc1200_config_dma;
-               hwif->ide_dma_end   = &sc1200_ide_dma_end;
-               if (!noautodma)
-                       hwif->autodma = 1;
-
-               hwif->set_pio_mode = &sc1200_set_pio_mode;
-               hwif->set_dma_mode = &sc1200_set_dma_mode;
-       }
+
+       hwif->set_pio_mode = &sc1200_set_pio_mode;
+       hwif->set_dma_mode = &sc1200_set_dma_mode;
+
+       if (hwif->dma_base == 0)
+               return;
+
+       hwif->udma_filter = sc1200_udma_filter;
+       hwif->ide_dma_check = &sc1200_config_dma;
+       hwif->ide_dma_end   = &sc1200_ide_dma_end;
+
+       if (!noautodma)
+               hwif->autodma = 1;
+
         hwif->atapi_dma = 1;
         hwif->ultra_mask = 0x07;
         hwif->mwdma_mask = 0x07;
-
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