diff mbox

[20/22] x86: gart: Add map_peer_resource stub

Message ID 1442337067-22964-21-git-send-email-wdavis@nvidia.com
State Changes Requested
Headers show

Commit Message

wdavis@nvidia.com Sept. 15, 2015, 5:11 p.m. UTC
Return error code to indicate no support.

Signed-off-by: Will Davis <wdavis@nvidia.com>
---
 arch/x86/kernel/amd_gart_64.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff mbox

Patch

diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c
index 8e3842f..6ba62e6 100644
--- a/arch/x86/kernel/amd_gart_64.c
+++ b/arch/x86/kernel/amd_gart_64.c
@@ -474,6 +474,19 @@  error:
 	return 0;
 }
 
+#ifdef CONFIG_HAS_DMA_P2P
+static dma_peer_addr_t gart_map_peer_resource(struct device *dev,
+					      struct device *peer,
+					      struct resource *res,
+					      unsigned long offset,
+					      size_t size,
+					      enum dma_data_direction dir,
+					      struct dma_attrs *attrs)
+{
+	return bad_dma_addr;
+}
+#endif
+
 /* allocate and map a coherent mapping */
 static void *
 gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr,
@@ -704,6 +717,9 @@  static struct dma_map_ops gart_dma_ops = {
 	.alloc				= gart_alloc_coherent,
 	.free				= gart_free_coherent,
 	.mapping_error			= gart_mapping_error,
+#ifdef CONFIG_HAS_DMA_P2P
+	.map_peer_resource		= gart_map_peer_resource,
+#endif
 };
 
 static void gart_iommu_shutdown(void)