diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-08-20 16:42:56 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-08-20 16:42:56 -0400 |
commit | e98d6e50be87c1ad2df81f73c7442cf631d6f931 (patch) | |
tree | 111a6349924c3dbe37baac19d002faca26610d3c /drivers/ide/pci/pdc202xx_old.c | |
parent | 01cc643ae3c7de35b63989b7b65e3ef3132e48e4 (diff) |
pdc202xx_old: add missing ->dma_base check
If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks
shouldn't be initialized or bad things will happen.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/pdc202xx_old.c')
-rw-r--r-- | drivers/ide/pci/pdc202xx_old.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index fbcb0bb9c956..e19a891171cb 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/ide/pci/pdc202xx_old.c Version 0.50 Mar 3, 2007 | 2 | * linux/drivers/ide/pci/pdc202xx_old.c Version 0.51 Jul 27, 2007 |
3 | * | 3 | * |
4 | * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org> | 4 | * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org> |
5 | * Copyright (C) 2006-2007 MontaVista Software, Inc. | 5 | * Copyright (C) 2006-2007 MontaVista Software, Inc. |
@@ -337,15 +337,18 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif) | |||
337 | 337 | ||
338 | hwif->speedproc = &pdc202xx_tune_chipset; | 338 | hwif->speedproc = &pdc202xx_tune_chipset; |
339 | 339 | ||
340 | hwif->err_stops_fifo = 1; | ||
341 | |||
340 | hwif->drives[0].autotune = hwif->drives[1].autotune = 1; | 342 | hwif->drives[0].autotune = hwif->drives[1].autotune = 1; |
341 | 343 | ||
344 | if (hwif->dma_base == 0) | ||
345 | return; | ||
346 | |||
342 | hwif->ultra_mask = hwif->cds->udma_mask; | 347 | hwif->ultra_mask = hwif->cds->udma_mask; |
343 | hwif->mwdma_mask = 0x07; | 348 | hwif->mwdma_mask = 0x07; |
344 | hwif->swdma_mask = 0x07; | 349 | hwif->swdma_mask = 0x07; |
345 | hwif->atapi_dma = 1; | 350 | hwif->atapi_dma = 1; |
346 | 351 | ||
347 | hwif->err_stops_fifo = 1; | ||
348 | |||
349 | hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate; | 352 | hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate; |
350 | hwif->dma_lost_irq = &pdc202xx_dma_lost_irq; | 353 | hwif->dma_lost_irq = &pdc202xx_dma_lost_irq; |
351 | hwif->dma_timeout = &pdc202xx_dma_timeout; | 354 | hwif->dma_timeout = &pdc202xx_dma_timeout; |