Commit 66c88342 authored by Jesse Barnes's avatar Jesse Barnes Committed by David Mosberger

[PATCH] ia64: implement SN2 version of dma_mapping_error()

On sn2, dma_mapping_error is trivial.  pci_map_single was already returning 0 
in case of failure (0 is an invalid DMA address on sn2), so make 
dma_mapping_error check for that.
parent e5e00914
...@@ -391,11 +391,9 @@ sn_pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) ...@@ -391,11 +391,9 @@ sn_pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
dma_map = pcibr_dmamap_alloc(vhdl, NULL, size, PCIIO_DMA_DATA | dma_map = pcibr_dmamap_alloc(vhdl, NULL, size, PCIIO_DMA_DATA |
MINIMAL_ATE_FLAG(phys_addr, size)); MINIMAL_ATE_FLAG(phys_addr, size));
if (!dma_map) { /* PMU out of entries */
printk(KERN_ERR "pci_map_single: Unable to allocate anymore " if (!dma_map)
"32 bit page map entries.\n");
return 0; return 0;
}
dma_addr = (dma_addr_t) pcibr_dmamap_addr(dma_map, phys_addr, size); dma_addr = (dma_addr_t) pcibr_dmamap_addr(dma_map, phys_addr, size);
dma_map->bd_dma_addr = dma_addr; dma_map->bd_dma_addr = dma_addr;
...@@ -655,6 +653,12 @@ EXPORT_SYMBOL(sn_dma_sync_sg_for_device); ...@@ -655,6 +653,12 @@ EXPORT_SYMBOL(sn_dma_sync_sg_for_device);
int int
sn_dma_mapping_error(dma_addr_t dma_addr) sn_dma_mapping_error(dma_addr_t dma_addr)
{ {
/*
* We can only run out of page mapping entries, so if there's
* an error, tell the caller to try again later.
*/
if (!dma_addr)
return -EAGAIN;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment