Commit 91a6fda95cb67c94b887355690d1923a7eb6f630

Authored by Christoph Hellwig
1 parent ddb26d8e1e

dma-mapping: remove dma_mark_declared_memory_occupied

This API is not used anywhere, so remove it.

Signed-off-by: Christoph Hellwig <hch@lst.de>

Showing 3 changed files with 0 additions and 49 deletions Side-by-side Diff

Documentation/DMA-API.txt
... ... @@ -605,23 +605,6 @@
605 605 driver's job to ensure that no parts of this memory region are
606 606 currently in use.
607 607  
608   -::
609   -
610   - void *
611   - dma_mark_declared_memory_occupied(struct device *dev,
612   - dma_addr_t device_addr, size_t size)
613   -
614   -This is used to occupy specific regions of the declared space
615   -(dma_alloc_coherent() will hand out the first free region it finds).
616   -
617   -device_addr is the *device* address of the region requested.
618   -
619   -size is the size (and should be a page-sized multiple).
620   -
621   -The return value will be either a pointer to the processor virtual
622   -address of the memory, or an error (via PTR_ERR()) if any part of the
623   -region is occupied.
624   -
625 608 Part III - Debug drivers use of the DMA-API
626 609 -------------------------------------------
627 610  
include/linux/dma-mapping.h
... ... @@ -743,8 +743,6 @@
743 743 int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
744 744 dma_addr_t device_addr, size_t size, int flags);
745 745 void dma_release_declared_memory(struct device *dev);
746   -void *dma_mark_declared_memory_occupied(struct device *dev,
747   - dma_addr_t device_addr, size_t size);
748 746 #else
749 747 static inline int
750 748 dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
... ... @@ -756,13 +754,6 @@
756 754 static inline void
757 755 dma_release_declared_memory(struct device *dev)
758 756 {
759   -}
760   -
761   -static inline void *
762   -dma_mark_declared_memory_occupied(struct device *dev,
763   - dma_addr_t device_addr, size_t size)
764   -{
765   - return ERR_PTR(-EBUSY);
766 757 }
767 758 #endif /* CONFIG_DMA_DECLARE_COHERENT */
768 759  
kernel/dma/coherent.c
... ... @@ -137,29 +137,6 @@
137 137 }
138 138 EXPORT_SYMBOL(dma_release_declared_memory);
139 139  
140   -void *dma_mark_declared_memory_occupied(struct device *dev,
141   - dma_addr_t device_addr, size_t size)
142   -{
143   - struct dma_coherent_mem *mem = dev->dma_mem;
144   - unsigned long flags;
145   - int pos, err;
146   -
147   - size += device_addr & ~PAGE_MASK;
148   -
149   - if (!mem)
150   - return ERR_PTR(-EINVAL);
151   -
152   - spin_lock_irqsave(&mem->spinlock, flags);
153   - pos = PFN_DOWN(device_addr - dma_get_device_base(dev, mem));
154   - err = bitmap_allocate_region(mem->bitmap, pos, get_order(size));
155   - spin_unlock_irqrestore(&mem->spinlock, flags);
156   -
157   - if (err != 0)
158   - return ERR_PTR(err);
159   - return mem->virt_base + (pos << PAGE_SHIFT);
160   -}
161   -EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
162   -
163 140 static void *__dma_alloc_from_coherent(struct dma_coherent_mem *mem,
164 141 ssize_t size, dma_addr_t *dma_handle)
165 142 {