ARM: pass size to dma_free_coherent
We'll need it later once we remap dma memory. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
d77ef33347
commit
8ba794abd4
|
@ -155,7 +155,7 @@ void *phys_to_virt(unsigned long phys)
|
||||||
return (void *)(phys + dma_coherent_offset);
|
return (void *)(phys + dma_coherent_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dma_free_coherent(void *mem)
|
void dma_free_coherent(void *mem, size_t size)
|
||||||
{
|
{
|
||||||
free(mem - dma_coherent_offset);
|
free(mem - dma_coherent_offset);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ void setup_dma_coherent(unsigned long offset);
|
||||||
|
|
||||||
#ifdef CONFIG_MMU
|
#ifdef CONFIG_MMU
|
||||||
void *dma_alloc_coherent(size_t size);
|
void *dma_alloc_coherent(size_t size);
|
||||||
void dma_free_coherent(void *mem);
|
void dma_free_coherent(void *mem, size_t size);
|
||||||
|
|
||||||
void dma_clean_range(unsigned long, unsigned long);
|
void dma_clean_range(unsigned long, unsigned long);
|
||||||
void dma_flush_range(unsigned long, unsigned long);
|
void dma_flush_range(unsigned long, unsigned long);
|
||||||
|
@ -26,12 +26,17 @@ unsigned long virt_to_phys(void *virt);
|
||||||
void *phys_to_virt(unsigned long phys);
|
void *phys_to_virt(unsigned long phys);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
static inline int mmu_init(void)
|
||||||
|
{
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
static inline void *dma_alloc_coherent(size_t size)
|
static inline void *dma_alloc_coherent(size_t size)
|
||||||
{
|
{
|
||||||
return xmemalign(4096, size);
|
return xmemalign(4096, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void dma_free_coherent(void *mem)
|
static inline void dma_free_coherent(void *mem, size_t size)
|
||||||
{
|
{
|
||||||
free(mem);
|
free(mem);
|
||||||
}
|
}
|
||||||
|
|
|
@ -560,7 +560,7 @@ static void done(struct fsl_ep *ep, struct fsl_req *req, int status)
|
||||||
if (j != req->dtd_count - 1) {
|
if (j != req->dtd_count - 1) {
|
||||||
next_td = curr_td->next_td_virt;
|
next_td = curr_td->next_td_virt;
|
||||||
}
|
}
|
||||||
dma_free_coherent(curr_td);
|
dma_free_coherent(curr_td, sizeof(struct ep_td_struct));
|
||||||
}
|
}
|
||||||
|
|
||||||
dma_inv_range((unsigned long)req->req.buf,
|
dma_inv_range((unsigned long)req->req.buf,
|
||||||
|
|
Loading…
Reference in New Issue