Commit f9f3232a authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

dma-mapping: explicitly wire up ->mmap and ->get_sgtable



While the default ->mmap and ->get_sgtable implementations work for the
majority of our dma_map_ops impementations they are inherently safe
for others that don't use the page allocator or CMA and/or use their
own way of remapping not covered by the common code.  So remove the
defaults if these methods are not wired up, but instead wire up the
default implementations for all safe instances.

Fixes: e1c7e324 ("dma-mapping: always provide the dma_map_ops based implementation")
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 14451467
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -955,5 +955,7 @@ const struct dma_map_ops alpha_pci_ops = {
	.map_sg			= alpha_pci_map_sg,
	.unmap_sg		= alpha_pci_unmap_sg,
	.dma_supported		= alpha_pci_supported,
	.mmap			= dma_common_mmap,
	.get_sgtable		= dma_common_get_sgtable,
};
EXPORT_SYMBOL(alpha_pci_ops);
+2 −0
Original line number Diff line number Diff line
@@ -2183,6 +2183,8 @@ const struct dma_map_ops sba_dma_ops = {
	.map_sg			= sba_map_sg_attrs,
	.unmap_sg		= sba_unmap_sg_attrs,
	.dma_supported		= sba_dma_supported,
	.mmap			= dma_common_mmap,
	.get_sgtable		= dma_common_get_sgtable,
};

void sba_dma_init(void)
+2 −0
Original line number Diff line number Diff line
@@ -438,6 +438,8 @@ static struct dma_map_ops sn_dma_ops = {
	.unmap_sg		= sn_dma_unmap_sg,
	.dma_supported		= sn_dma_supported,
	.get_required_mask	= sn_dma_get_required_mask,
	.mmap			= dma_common_mmap,
	.get_sgtable		= dma_common_get_sgtable,
};

void sn_dma_init(void)
+2 −0
Original line number Diff line number Diff line
@@ -682,5 +682,7 @@ const struct dma_map_ops jazz_dma_ops = {
	.sync_sg_for_device	= jazz_dma_sync_sg_for_device,
	.dma_supported		= dma_direct_supported,
	.cache_sync		= arch_dma_cache_sync,
	.mmap			= dma_common_mmap,
	.get_sgtable		= dma_common_get_sgtable,
};
EXPORT_SYMBOL(jazz_dma_ops);
+2 −0
Original line number Diff line number Diff line
@@ -208,4 +208,6 @@ const struct dma_map_ops dma_iommu_ops = {
	.sync_single_for_device	= dma_iommu_sync_for_device,
	.sync_sg_for_cpu	= dma_iommu_sync_sg_for_cpu,
	.sync_sg_for_device	= dma_iommu_sync_sg_for_device,
	.mmap			= dma_common_mmap,
	.get_sgtable		= dma_common_get_sgtable,
};
Loading