Skip to content

Commit b0615c3

Browse files
author
Christoph Hellwig
committed
microblaze: remove the dead !NOT_COHERENT_CACHE dma code
Signed-off-by: Christoph Hellwig <[email protected]>
1 parent a5feb60 commit b0615c3

File tree

1 file changed

+0
-28
lines changed
  • arch/microblaze/kernel

1 file changed

+0
-28
lines changed

arch/microblaze/kernel/dma.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,18 @@
1515
#include <linux/bug.h>
1616
#include <asm/cacheflush.h>
1717

18-
#define NOT_COHERENT_CACHE
19-
2018
static void *dma_nommu_alloc_coherent(struct device *dev, size_t size,
2119
dma_addr_t *dma_handle, gfp_t flag,
2220
unsigned long attrs)
2321
{
24-
#ifdef NOT_COHERENT_CACHE
2522
return consistent_alloc(flag, size, dma_handle);
26-
#else
27-
void *ret;
28-
struct page *page;
29-
int node = dev_to_node(dev);
30-
31-
/* ignore region specifiers */
32-
flag &= ~(__GFP_HIGHMEM);
33-
34-
page = alloc_pages_node(node, flag, get_order(size));
35-
if (page == NULL)
36-
return NULL;
37-
ret = page_address(page);
38-
memset(ret, 0, size);
39-
*dma_handle = virt_to_phys(ret);
40-
41-
return ret;
42-
#endif
4323
}
4424

4525
static void dma_nommu_free_coherent(struct device *dev, size_t size,
4626
void *vaddr, dma_addr_t dma_handle,
4727
unsigned long attrs)
4828
{
49-
#ifdef NOT_COHERENT_CACHE
5029
consistent_free(size, vaddr);
51-
#else
52-
free_pages((unsigned long)vaddr, get_order(size));
53-
#endif
5430
}
5531

5632
static inline void __dma_sync(unsigned long paddr,
@@ -186,12 +162,8 @@ int dma_nommu_mmap_coherent(struct device *dev, struct vm_area_struct *vma,
186162
if (off >= count || user_count > (count - off))
187163
return -ENXIO;
188164

189-
#ifdef NOT_COHERENT_CACHE
190165
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
191166
pfn = consistent_virt_to_pfn(cpu_addr);
192-
#else
193-
pfn = virt_to_pfn(cpu_addr);
194-
#endif
195167
return remap_pfn_range(vma, vma->vm_start, pfn + off,
196168
vma->vm_end - vma->vm_start, vma->vm_page_prot);
197169
#else

0 commit comments

Comments
 (0)