dma-mapping: fix the prototype of dma_map_single()
Make dma_map_single() return the dma address, and remove the pointless volatile. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:

committed by
Peng Fan

parent
ede2822864
commit
c22c0dbd7d
@@ -11,6 +11,7 @@
|
|||||||
#include <asm/cache.h>
|
#include <asm/cache.h>
|
||||||
#include <cpu_func.h>
|
#include <cpu_func.h>
|
||||||
#include <linux/dma-direction.h>
|
#include <linux/dma-direction.h>
|
||||||
|
#include <linux/types.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
#define dma_mapping_error(x, y) 0
|
#define dma_mapping_error(x, y) 0
|
||||||
@@ -26,8 +27,8 @@ static inline void dma_free_coherent(void *addr)
|
|||||||
free(addr);
|
free(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned long dma_map_single(volatile void *vaddr, size_t len,
|
static inline dma_addr_t dma_map_single(void *vaddr, size_t len,
|
||||||
enum dma_data_direction dir)
|
enum dma_data_direction dir)
|
||||||
{
|
{
|
||||||
unsigned long addr = (unsigned long)vaddr;
|
unsigned long addr = (unsigned long)vaddr;
|
||||||
|
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
#include <asm/cache.h>
|
#include <asm/cache.h>
|
||||||
#include <cpu_func.h>
|
#include <cpu_func.h>
|
||||||
#include <linux/dma-direction.h>
|
#include <linux/dma-direction.h>
|
||||||
|
#include <linux/types.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
static void *dma_alloc_coherent(size_t len, unsigned long *handle)
|
static void *dma_alloc_coherent(size_t len, unsigned long *handle)
|
||||||
@@ -18,8 +19,8 @@ static void *dma_alloc_coherent(size_t len, unsigned long *handle)
|
|||||||
return (void *)*handle;
|
return (void *)*handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned long dma_map_single(volatile void *vaddr, size_t len,
|
static inline dma_addr_t dma_map_single(void *vaddr, size_t len,
|
||||||
enum dma_data_direction dir)
|
enum dma_data_direction dir)
|
||||||
{
|
{
|
||||||
unsigned long addr = (unsigned long)vaddr;
|
unsigned long addr = (unsigned long)vaddr;
|
||||||
|
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
#define __ASM_RISCV_DMA_MAPPING_H
|
#define __ASM_RISCV_DMA_MAPPING_H
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
#include <linux/types.h>
|
||||||
#include <asm/cache.h>
|
#include <asm/cache.h>
|
||||||
#include <cpu_func.h>
|
#include <cpu_func.h>
|
||||||
#include <linux/dma-direction.h>
|
#include <linux/dma-direction.h>
|
||||||
@@ -28,8 +29,8 @@ static inline void dma_free_coherent(void *addr)
|
|||||||
free(addr);
|
free(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned long dma_map_single(volatile void *vaddr, size_t len,
|
static inline dma_addr_t dma_map_single(void *vaddr, size_t len,
|
||||||
enum dma_data_direction dir)
|
enum dma_data_direction dir)
|
||||||
{
|
{
|
||||||
unsigned long addr = (unsigned long)vaddr;
|
unsigned long addr = (unsigned long)vaddr;
|
||||||
|
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
#include <asm/cache.h>
|
#include <asm/cache.h>
|
||||||
#include <cpu_func.h>
|
#include <cpu_func.h>
|
||||||
#include <linux/dma-direction.h>
|
#include <linux/dma-direction.h>
|
||||||
|
#include <linux/types.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
#define dma_mapping_error(x, y) 0
|
#define dma_mapping_error(x, y) 0
|
||||||
@@ -26,8 +27,8 @@ static inline void dma_free_coherent(void *addr)
|
|||||||
free(addr);
|
free(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned long dma_map_single(volatile void *vaddr, size_t len,
|
static inline dma_addr_t dma_map_single(void *vaddr, size_t len,
|
||||||
enum dma_data_direction dir)
|
enum dma_data_direction dir)
|
||||||
{
|
{
|
||||||
unsigned long addr = (unsigned long)vaddr;
|
unsigned long addr = (unsigned long)vaddr;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user