aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-13 11:47:52 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-13 11:47:52 -0400
commit7bda292d12795877ade9a7ccc044a7bb0ea8e8b4 (patch)
tree1b098530b7a5c70fe3aff7e17283ddef2ba11304
parent76bb7782c6831bf450b964eb7596e21bcd23fc32 (diff)
cs5535: 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>
-rw-r--r--drivers/ide/pci/cs5535.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c
index da606ba6d28c..257865778f92 100644
--- a/drivers/ide/pci/cs5535.c
+++ b/drivers/ide/pci/cs5535.c
@@ -190,12 +190,16 @@ static u8 __devinit cs5535_cable_detect(struct pci_dev *dev)
190 */ 190 */
191static void __devinit init_hwif_cs5535(ide_hwif_t *hwif) 191static void __devinit init_hwif_cs5535(ide_hwif_t *hwif)
192{ 192{
193 int i;
194
195 hwif->autodma = 0; 193 hwif->autodma = 0;
196 194
197 hwif->set_pio_mode = &cs5535_set_pio_mode; 195 hwif->set_pio_mode = &cs5535_set_pio_mode;
198 hwif->set_dma_mode = &cs5535_set_dma_mode; 196 hwif->set_dma_mode = &cs5535_set_dma_mode;
197
198 hwif->drives[1].autotune = hwif->drives[0].autotune = 1;
199
200 if (hwif->dma_base == 0)
201 return;
202
199 hwif->ide_dma_check = &cs5535_dma_check; 203 hwif->ide_dma_check = &cs5535_dma_check;
200 204
201 hwif->atapi_dma = 1; 205 hwif->atapi_dma = 1;
@@ -207,11 +211,7 @@ static void __devinit init_hwif_cs5535(ide_hwif_t *hwif)
207 if (!noautodma) 211 if (!noautodma)
208 hwif->autodma = 1; 212 hwif->autodma = 1;
209 213
210 /* just setting autotune and not worrying about bios timings */ 214 hwif->drives[1].autodma = hwif->drives[0].autodma = hwif->autodma;
211 for (i = 0; i < 2; i++) {
212 hwif->drives[i].autotune = 1;
213 hwif->drives[i].autodma = hwif->autodma;
214 }
215} 215}
216 216
217static ide_pci_device_t cs5535_chipset __devinitdata = { 217static ide_pci_device_t cs5535_chipset __devinitdata = {