]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/arm/mm/dma-mapping.c
Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
[karo-tx-linux.git] / arch / arm / mm / dma-mapping.c
index 6ffdf17e0d5cf6a15ac816ca6317e42e3fee6b61..63eabb06f9f17551695e89efc0ed59e0ce6ba186 100644 (file)
@@ -180,7 +180,7 @@ static void arm_dma_sync_single_for_device(struct device *dev,
        __dma_page_cpu_to_dev(page, offset, size, dir);
 }
 
-struct dma_map_ops arm_dma_ops = {
+const struct dma_map_ops arm_dma_ops = {
        .alloc                  = arm_dma_alloc,
        .free                   = arm_dma_free,
        .mmap                   = arm_dma_mmap,
@@ -204,7 +204,7 @@ static int arm_coherent_dma_mmap(struct device *dev, struct vm_area_struct *vma,
                 void *cpu_addr, dma_addr_t dma_addr, size_t size,
                 unsigned long attrs);
 
-struct dma_map_ops arm_coherent_dma_ops = {
+const struct dma_map_ops arm_coherent_dma_ops = {
        .alloc                  = arm_coherent_dma_alloc,
        .free                   = arm_coherent_dma_free,
        .mmap                   = arm_coherent_dma_mmap,
@@ -870,6 +870,9 @@ static int __arm_dma_mmap(struct device *dev, struct vm_area_struct *vma,
                                      vma->vm_end - vma->vm_start,
                                      vma->vm_page_prot);
        }
+#else
+       ret = vm_iomap_memory(vma, vma->vm_start,
+                             (vma->vm_end - vma->vm_start));
 #endif /* CONFIG_MMU */
 
        return ret;
@@ -1069,7 +1072,7 @@ static void __dma_page_dev_to_cpu(struct page *page, unsigned long off,
 int arm_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
                enum dma_data_direction dir, unsigned long attrs)
 {
-       struct dma_map_ops *ops = get_dma_ops(dev);
+       const struct dma_map_ops *ops = get_dma_ops(dev);
        struct scatterlist *s;
        int i, j;
 
@@ -1103,7 +1106,7 @@ int arm_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
 void arm_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
                enum dma_data_direction dir, unsigned long attrs)
 {
-       struct dma_map_ops *ops = get_dma_ops(dev);
+       const struct dma_map_ops *ops = get_dma_ops(dev);
        struct scatterlist *s;
 
        int i;
@@ -1122,7 +1125,7 @@ void arm_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
 void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
                        int nents, enum dma_data_direction dir)
 {
-       struct dma_map_ops *ops = get_dma_ops(dev);
+       const struct dma_map_ops *ops = get_dma_ops(dev);
        struct scatterlist *s;
        int i;
 
@@ -1141,7 +1144,7 @@ void arm_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
 void arm_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
                        int nents, enum dma_data_direction dir)
 {
-       struct dma_map_ops *ops = get_dma_ops(dev);
+       const struct dma_map_ops *ops = get_dma_ops(dev);
        struct scatterlist *s;
        int i;
 
@@ -2101,7 +2104,7 @@ static void arm_iommu_sync_single_for_device(struct device *dev,
        __dma_page_cpu_to_dev(page, offset, size, dir);
 }
 
-struct dma_map_ops iommu_ops = {
+const struct dma_map_ops iommu_ops = {
        .alloc          = arm_iommu_alloc_attrs,
        .free           = arm_iommu_free_attrs,
        .mmap           = arm_iommu_mmap_attrs,
@@ -2121,7 +2124,7 @@ struct dma_map_ops iommu_ops = {
        .unmap_resource         = arm_iommu_unmap_resource,
 };
 
-struct dma_map_ops iommu_coherent_ops = {
+const struct dma_map_ops iommu_coherent_ops = {
        .alloc          = arm_coherent_iommu_alloc_attrs,
        .free           = arm_coherent_iommu_free_attrs,
        .mmap           = arm_coherent_iommu_mmap_attrs,
@@ -2321,7 +2324,7 @@ void arm_iommu_detach_device(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(arm_iommu_detach_device);
 
-static struct dma_map_ops *arm_get_iommu_dma_map_ops(bool coherent)
+static const struct dma_map_ops *arm_get_iommu_dma_map_ops(bool coherent)
 {
        return coherent ? &iommu_coherent_ops : &iommu_ops;
 }
@@ -2376,7 +2379,7 @@ static void arm_teardown_iommu_dma_ops(struct device *dev) { }
 
 #endif /* CONFIG_ARM_DMA_USE_IOMMU */
 
-static struct dma_map_ops *arm_get_dma_map_ops(bool coherent)
+static const struct dma_map_ops *arm_get_dma_map_ops(bool coherent)
 {
        return coherent ? &arm_coherent_dma_ops : &arm_dma_ops;
 }
@@ -2384,7 +2387,7 @@ static struct dma_map_ops *arm_get_dma_map_ops(bool coherent)
 void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
                        const struct iommu_ops *iommu, bool coherent)
 {
-       struct dma_map_ops *dma_ops;
+       const struct dma_map_ops *dma_ops;
 
        dev->archdata.dma_coherent = coherent;
        if (arm_setup_iommu_dma_ops(dev, dma_base, size, iommu))