diff options
| author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-05-12 23:19:01 +0200 |
|---|---|---|
| committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-05-12 23:20:33 +0200 |
| commit | a9aa1d02de36b450990b0e25a88fc2ff1c3e6b94 (patch) | |
| tree | 1f9d19f1642d263e65906a916a48be9339accc73 /arch/sparc/include/asm/dma-mapping.h | |
| parent | 5671a10e2bc7f99d9157c6044faf8be2ef302361 (diff) | |
| parent | b57f95a38233a2e73b679bea4a5453a1cc2a1cc9 (diff) | |
Merge commit 'v2.6.34-rc7' into perf/nmi
Merge reason: catch up with latest softlockup detector changes.
Diffstat (limited to 'arch/sparc/include/asm/dma-mapping.h')
| -rw-r--r-- | arch/sparc/include/asm/dma-mapping.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/sparc/include/asm/dma-mapping.h b/arch/sparc/include/asm/dma-mapping.h index 5a8c308e2b5c..4b4a0c0b0ccd 100644 --- a/arch/sparc/include/asm/dma-mapping.h +++ b/arch/sparc/include/asm/dma-mapping.h @@ -8,7 +8,6 @@ #define DMA_ERROR_CODE (~(dma_addr_t)0x0) extern int dma_supported(struct device *dev, u64 mask); -extern int dma_set_mask(struct device *dev, u64 dma_mask); #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) @@ -62,4 +61,17 @@ static inline int dma_get_cache_alignment(void) return (1 << INTERNODE_CACHE_SHIFT); } +static inline int dma_set_mask(struct device *dev, u64 mask) +{ +#ifdef CONFIG_PCI + if (dev->bus == &pci_bus_type) { + if (!dev->dma_mask || !dma_supported(dev, mask)) + return -EINVAL; + *dev->dma_mask = mask; + return 0; + } +#endif + return -EINVAL; +} + #endif |
