aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm/fore200e.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/atm/fore200e.c')
-rw-r--r--drivers/atm/fore200e.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index d5d9eafbbfcf..75dde903b238 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -425,7 +425,7 @@ static void fore200e_pca_write(u32 val, volatile u32 __iomem *addr)
425static u32 425static u32
426fore200e_pca_dma_map(struct fore200e* fore200e, void* virt_addr, int size, int direction) 426fore200e_pca_dma_map(struct fore200e* fore200e, void* virt_addr, int size, int direction)
427{ 427{
428 u32 dma_addr = pci_map_single((struct pci_dev*)fore200e->bus_dev, virt_addr, size, direction); 428 u32 dma_addr = dma_map_single(&((struct pci_dev *) fore200e->bus_dev)->dev, virt_addr, size, direction);
429 429
430 DPRINTK(3, "PCI DVMA mapping: virt_addr = 0x%p, size = %d, direction = %d, --> dma_addr = 0x%08x\n", 430 DPRINTK(3, "PCI DVMA mapping: virt_addr = 0x%p, size = %d, direction = %d, --> dma_addr = 0x%08x\n",
431 virt_addr, size, direction, dma_addr); 431 virt_addr, size, direction, dma_addr);
@@ -440,7 +440,7 @@ fore200e_pca_dma_unmap(struct fore200e* fore200e, u32 dma_addr, int size, int di
440 DPRINTK(3, "PCI DVMA unmapping: dma_addr = 0x%08x, size = %d, direction = %d\n", 440 DPRINTK(3, "PCI DVMA unmapping: dma_addr = 0x%08x, size = %d, direction = %d\n",
441 dma_addr, size, direction); 441 dma_addr, size, direction);
442 442
443 pci_unmap_single((struct pci_dev*)fore200e->bus_dev, dma_addr, size, direction); 443 dma_unmap_single(&((struct pci_dev *) fore200e->bus_dev)->dev, dma_addr, size, direction);
444} 444}
445 445
446 446
@@ -449,7 +449,7 @@ fore200e_pca_dma_sync_for_cpu(struct fore200e* fore200e, u32 dma_addr, int size,
449{ 449{
450 DPRINTK(3, "PCI DVMA sync: dma_addr = 0x%08x, size = %d, direction = %d\n", dma_addr, size, direction); 450 DPRINTK(3, "PCI DVMA sync: dma_addr = 0x%08x, size = %d, direction = %d\n", dma_addr, size, direction);
451 451
452 pci_dma_sync_single_for_cpu((struct pci_dev*)fore200e->bus_dev, dma_addr, size, direction); 452 dma_sync_single_for_cpu(&((struct pci_dev *) fore200e->bus_dev)->dev, dma_addr, size, direction);
453} 453}
454 454
455static void 455static void
@@ -457,7 +457,7 @@ fore200e_pca_dma_sync_for_device(struct fore200e* fore200e, u32 dma_addr, int si
457{ 457{
458 DPRINTK(3, "PCI DVMA sync: dma_addr = 0x%08x, size = %d, direction = %d\n", dma_addr, size, direction); 458 DPRINTK(3, "PCI DVMA sync: dma_addr = 0x%08x, size = %d, direction = %d\n", dma_addr, size, direction);
459 459
460 pci_dma_sync_single_for_device((struct pci_dev*)fore200e->bus_dev, dma_addr, size, direction); 460 dma_sync_single_for_device(&((struct pci_dev *) fore200e->bus_dev)->dev, dma_addr, size, direction);
461} 461}
462 462
463 463
@@ -470,9 +470,10 @@ fore200e_pca_dma_chunk_alloc(struct fore200e* fore200e, struct chunk* chunk,
470{ 470{
471 /* returned chunks are page-aligned */ 471 /* returned chunks are page-aligned */
472 chunk->alloc_size = size * nbr; 472 chunk->alloc_size = size * nbr;
473 chunk->alloc_addr = pci_alloc_consistent((struct pci_dev*)fore200e->bus_dev, 473 chunk->alloc_addr = dma_alloc_coherent(&((struct pci_dev *) fore200e->bus_dev)->dev,
474 chunk->alloc_size, 474 chunk->alloc_size,
475 &chunk->dma_addr); 475 &chunk->dma_addr,
476 GFP_KERNEL);
476 477
477 if ((chunk->alloc_addr == NULL) || (chunk->dma_addr == 0)) 478 if ((chunk->alloc_addr == NULL) || (chunk->dma_addr == 0))
478 return -ENOMEM; 479 return -ENOMEM;
@@ -488,7 +489,7 @@ fore200e_pca_dma_chunk_alloc(struct fore200e* fore200e, struct chunk* chunk,
488static void 489static void
489fore200e_pca_dma_chunk_free(struct fore200e* fore200e, struct chunk* chunk) 490fore200e_pca_dma_chunk_free(struct fore200e* fore200e, struct chunk* chunk)
490{ 491{
491 pci_free_consistent((struct pci_dev*)fore200e->bus_dev, 492 dma_free_coherent(&((struct pci_dev *) fore200e->bus_dev)->dev,
492 chunk->alloc_size, 493 chunk->alloc_size,
493 chunk->alloc_addr, 494 chunk->alloc_addr,
494 chunk->dma_addr); 495 chunk->dma_addr);
@@ -2707,6 +2708,11 @@ static int fore200e_pca_detect(struct pci_dev *pci_dev,
2707 err = -EINVAL; 2708 err = -EINVAL;
2708 goto out; 2709 goto out;
2709 } 2710 }
2711
2712 if (dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32))) {
2713 err = -EINVAL;
2714 goto out;
2715 }
2710 2716
2711 fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL); 2717 fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL);
2712 if (fore200e == NULL) { 2718 if (fore200e == NULL) {