aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-08-20 16:42:56 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-08-20 16:42:56 -0400
commit01cc643ae3c7de35b63989b7b65e3ef3132e48e4 (patch)
tree65f90e393855ff1a457680040df7b5d6b36e0d54 /drivers
parentf7b0d2df2f6fd9abdf47b4a1965dcaa2870e35df (diff)
pdc202xx_new: 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. Also this host driver requires valid PCI BAR4 for normal operation so check it in ->init_chipset and fail initialization if not set. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/pci/pdc202xx_new.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 8a66a2871b3a..f6db2f37efad 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -378,6 +378,9 @@ static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const cha
378 int f, r; 378 int f, r;
379 u8 pll_ctl0, pll_ctl1; 379 u8 pll_ctl0, pll_ctl1;
380 380
381 if (dma_base == 0)
382 return -EFAULT;
383
381#ifdef CONFIG_PPC_PMAC 384#ifdef CONFIG_PPC_PMAC
382 apple_kiwi_init(dev); 385 apple_kiwi_init(dev);
383#endif 386#endif
@@ -494,15 +497,18 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
494 hwif->speedproc = &pdcnew_tune_chipset; 497 hwif->speedproc = &pdcnew_tune_chipset;
495 hwif->resetproc = &pdcnew_reset; 498 hwif->resetproc = &pdcnew_reset;
496 499
500 hwif->err_stops_fifo = 1;
501
497 hwif->drives[0].autotune = hwif->drives[1].autotune = 1; 502 hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
498 503
504 if (hwif->dma_base == 0)
505 return;
506
499 hwif->atapi_dma = 1; 507 hwif->atapi_dma = 1;
500 508
501 hwif->ultra_mask = hwif->cds->udma_mask; 509 hwif->ultra_mask = hwif->cds->udma_mask;
502 hwif->mwdma_mask = 0x07; 510 hwif->mwdma_mask = 0x07;
503 511
504 hwif->err_stops_fifo = 1;
505
506 hwif->ide_dma_check = &pdcnew_config_drive_xfer_rate; 512 hwif->ide_dma_check = &pdcnew_config_drive_xfer_rate;
507 513
508 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 514 if (hwif->cbl != ATA_CBL_PATA40_SHORT)