aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci')
-rw-r--r--drivers/ide/pci/scc_pata.c14
-rw-r--r--drivers/ide/pci/sgiioc4.c15
2 files changed, 14 insertions, 15 deletions
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c
index 3e75bf5f5e37..9ce1d8059921 100644
--- a/drivers/ide/pci/scc_pata.c
+++ b/drivers/ide/pci/scc_pata.c
@@ -821,6 +821,12 @@ static void __devinit init_iops_scc(ide_hwif_t *hwif)
821 init_mmio_iops_scc(hwif); 821 init_mmio_iops_scc(hwif);
822} 822}
823 823
824static int __devinit scc_init_dma(ide_hwif_t *hwif,
825 const struct ide_port_info *d)
826{
827 return ide_allocate_dma_engine(hwif);
828}
829
824static u8 scc_cable_detect(ide_hwif_t *hwif) 830static u8 scc_cable_detect(ide_hwif_t *hwif)
825{ 831{
826 return ATA_CBL_PATA80; 832 return ATA_CBL_PATA80;
@@ -885,6 +891,7 @@ static const struct ide_dma_ops scc_dma_ops = {
885 { \ 891 { \
886 .name = name_str, \ 892 .name = name_str, \
887 .init_iops = init_iops_scc, \ 893 .init_iops = init_iops_scc, \
894 .init_dma = scc_init_dma, \
888 .init_hwif = init_hwif_scc, \ 895 .init_hwif = init_hwif_scc, \
889 .tp_ops = &scc_tp_ops, \ 896 .tp_ops = &scc_tp_ops, \
890 .port_ops = &scc_port_ops, \ 897 .port_ops = &scc_port_ops, \
@@ -922,13 +929,6 @@ static void __devexit scc_remove(struct pci_dev *dev)
922{ 929{
923 struct scc_ports *ports = pci_get_drvdata(dev); 930 struct scc_ports *ports = pci_get_drvdata(dev);
924 struct ide_host *host = ports->host; 931 struct ide_host *host = ports->host;
925 ide_hwif_t *hwif = host->ports[0];
926
927 if (hwif->dmatable_cpu) {
928 pci_free_consistent(dev, PRD_ENTRIES * PRD_BYTES,
929 hwif->dmatable_cpu, hwif->dmatable_dma);
930 hwif->dmatable_cpu = NULL;
931 }
932 932
933 ide_host_remove(host); 933 ide_host_remove(host);
934 934
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index 84cd986810cf..dd634541ce36 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -357,14 +357,13 @@ ide_dma_sgiioc4(ide_hwif_t *hwif, const struct ide_port_info *d)
357 } 357 }
358 hwif->dma_base = (unsigned long) virt_dma_base; 358 hwif->dma_base = (unsigned long) virt_dma_base;
359 359
360 hwif->dmatable_cpu = pci_alloc_consistent(dev, 360 hwif->sg_max_nents = IOC4_PRD_ENTRIES;
361 IOC4_PRD_ENTRIES * IOC4_PRD_BYTES,
362 &hwif->dmatable_dma);
363 361
364 if (!hwif->dmatable_cpu) 362 hwif->prd_max_nents = IOC4_PRD_ENTRIES;
365 goto dma_pci_alloc_failure; 363 hwif->prd_ent_size = IOC4_PRD_BYTES;
366 364
367 hwif->sg_max_nents = IOC4_PRD_ENTRIES; 365 if (ide_allocate_dma_engine(hwif))
366 goto dma_pci_alloc_failure;
368 367
369 pad = pci_alloc_consistent(dev, IOC4_IDE_CACHELINE_SIZE, 368 pad = pci_alloc_consistent(dev, IOC4_IDE_CACHELINE_SIZE,
370 (dma_addr_t *)&hwif->extra_base); 369 (dma_addr_t *)&hwif->extra_base);
@@ -373,8 +372,8 @@ ide_dma_sgiioc4(ide_hwif_t *hwif, const struct ide_port_info *d)
373 return 0; 372 return 0;
374 } 373 }
375 374
376 pci_free_consistent(dev, IOC4_PRD_ENTRIES * IOC4_PRD_BYTES, 375 ide_release_dma_engine(hwif);
377 hwif->dmatable_cpu, hwif->dmatable_dma); 376
378 printk(KERN_ERR "%s(%s) -- ERROR: Unable to allocate DMA maps\n", 377 printk(KERN_ERR "%s(%s) -- ERROR: Unable to allocate DMA maps\n",
379 __func__, hwif->name); 378 __func__, hwif->name);
380 printk(KERN_INFO "%s: changing from DMA to PIO mode", hwif->name); 379 printk(KERN_INFO "%s: changing from DMA to PIO mode", hwif->name);