Commit 418a7a7e authored by Christoph Hellwig's avatar Christoph Hellwig

arm: remove arch specific dma_supported implementation

And instead wire it up as method for all the dma_map_ops instances.

Note that the code seems a little fishy for dmabounce and iommu, but
for now I'd like to preserve the existing behavior 1:1.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 19ad53e4
...@@ -473,6 +473,7 @@ static const struct dma_map_ops dmabounce_ops = { ...@@ -473,6 +473,7 @@ static const struct dma_map_ops dmabounce_ops = {
.sync_sg_for_device = arm_dma_sync_sg_for_device, .sync_sg_for_device = arm_dma_sync_sg_for_device,
.set_dma_mask = dmabounce_set_mask, .set_dma_mask = dmabounce_set_mask,
.mapping_error = dmabounce_mapping_error, .mapping_error = dmabounce_mapping_error,
.dma_supported = arm_dma_supported,
}; };
static int dmabounce_init_pool(struct dmabounce_pool *pool, struct device *dev, static int dmabounce_init_pool(struct dmabounce_pool *pool, struct device *dev,
......
...@@ -35,5 +35,7 @@ int arm_iommu_attach_device(struct device *dev, ...@@ -35,5 +35,7 @@ int arm_iommu_attach_device(struct device *dev,
struct dma_iommu_mapping *mapping); struct dma_iommu_mapping *mapping);
void arm_iommu_detach_device(struct device *dev); void arm_iommu_detach_device(struct device *dev);
int arm_dma_supported(struct device *dev, u64 mask);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif #endif
...@@ -20,9 +20,6 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) ...@@ -20,9 +20,6 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
return &arm_dma_ops; return &arm_dma_ops;
} }
#define HAVE_ARCH_DMA_SUPPORTED 1
extern int dma_supported(struct device *dev, u64 mask);
#ifdef __arch_page_to_dma #ifdef __arch_page_to_dma
#error Please update to __arch_pfn_to_dma #error Please update to __arch_pfn_to_dma
#endif #endif
......
...@@ -199,6 +199,7 @@ const struct dma_map_ops arm_dma_ops = { ...@@ -199,6 +199,7 @@ const struct dma_map_ops arm_dma_ops = {
.sync_sg_for_cpu = arm_dma_sync_sg_for_cpu, .sync_sg_for_cpu = arm_dma_sync_sg_for_cpu,
.sync_sg_for_device = arm_dma_sync_sg_for_device, .sync_sg_for_device = arm_dma_sync_sg_for_device,
.mapping_error = arm_dma_mapping_error, .mapping_error = arm_dma_mapping_error,
.dma_supported = arm_dma_supported,
}; };
EXPORT_SYMBOL(arm_dma_ops); EXPORT_SYMBOL(arm_dma_ops);
...@@ -218,6 +219,7 @@ const struct dma_map_ops arm_coherent_dma_ops = { ...@@ -218,6 +219,7 @@ const struct dma_map_ops arm_coherent_dma_ops = {
.map_page = arm_coherent_dma_map_page, .map_page = arm_coherent_dma_map_page,
.map_sg = arm_dma_map_sg, .map_sg = arm_dma_map_sg,
.mapping_error = arm_dma_mapping_error, .mapping_error = arm_dma_mapping_error,
.dma_supported = arm_dma_supported,
}; };
EXPORT_SYMBOL(arm_coherent_dma_ops); EXPORT_SYMBOL(arm_coherent_dma_ops);
...@@ -1184,11 +1186,10 @@ void arm_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, ...@@ -1184,11 +1186,10 @@ void arm_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
* during bus mastering, then you would pass 0x00ffffff as the mask * during bus mastering, then you would pass 0x00ffffff as the mask
* to this function. * to this function.
*/ */
int dma_supported(struct device *dev, u64 mask) int arm_dma_supported(struct device *dev, u64 mask)
{ {
return __dma_supported(dev, mask, false); return __dma_supported(dev, mask, false);
} }
EXPORT_SYMBOL(dma_supported);
#define PREALLOC_DMA_DEBUG_ENTRIES 4096 #define PREALLOC_DMA_DEBUG_ENTRIES 4096
...@@ -2149,6 +2150,7 @@ const struct dma_map_ops iommu_ops = { ...@@ -2149,6 +2150,7 @@ const struct dma_map_ops iommu_ops = {
.unmap_resource = arm_iommu_unmap_resource, .unmap_resource = arm_iommu_unmap_resource,
.mapping_error = arm_dma_mapping_error, .mapping_error = arm_dma_mapping_error,
.dma_supported = arm_dma_supported,
}; };
const struct dma_map_ops iommu_coherent_ops = { const struct dma_map_ops iommu_coherent_ops = {
...@@ -2167,6 +2169,7 @@ const struct dma_map_ops iommu_coherent_ops = { ...@@ -2167,6 +2169,7 @@ const struct dma_map_ops iommu_coherent_ops = {
.unmap_resource = arm_iommu_unmap_resource, .unmap_resource = arm_iommu_unmap_resource,
.mapping_error = arm_dma_mapping_error, .mapping_error = arm_dma_mapping_error,
.dma_supported = arm_dma_supported,
}; };
/** /**
......
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