Commit 333c9624 authored by Russell King's avatar Russell King Committed by Russell King

[ARM] Move ISA DMA bus_to_virt() out of set_dma_addr()

Allow the compiler to optimise the bus_to_virt(virt_to_bus())
transformation in the ARM ISA DMA interface.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 109a9378
...@@ -131,7 +131,7 @@ void set_dma_sg (dmach_t channel, struct scatterlist *sg, int nr_sg) ...@@ -131,7 +131,7 @@ void set_dma_sg (dmach_t channel, struct scatterlist *sg, int nr_sg)
* *
* Copy address to the structure, and set the invalid bit * Copy address to the structure, and set the invalid bit
*/ */
void set_dma_addr (dmach_t channel, unsigned long physaddr) void __set_dma_addr (dmach_t channel, void *addr)
{ {
dma_t *dma = dma_chan + channel; dma_t *dma = dma_chan + channel;
...@@ -141,7 +141,7 @@ void set_dma_addr (dmach_t channel, unsigned long physaddr) ...@@ -141,7 +141,7 @@ void set_dma_addr (dmach_t channel, unsigned long physaddr)
dma->sg = &dma->buf; dma->sg = &dma->buf;
dma->sgcount = 1; dma->sgcount = 1;
dma->buf.__address = bus_to_virt(physaddr); dma->buf.__address = addr;
dma->using_sg = 0; dma->using_sg = 0;
dma->invalid = 1; dma->invalid = 1;
} }
...@@ -278,7 +278,7 @@ GLOBAL_ALIAS(get_dma_list, get_dma_residue); ...@@ -278,7 +278,7 @@ GLOBAL_ALIAS(get_dma_list, get_dma_residue);
GLOBAL_ALIAS(set_dma_mode, get_dma_residue); GLOBAL_ALIAS(set_dma_mode, get_dma_residue);
GLOBAL_ALIAS(set_dma_page, get_dma_residue); GLOBAL_ALIAS(set_dma_page, get_dma_residue);
GLOBAL_ALIAS(set_dma_count, get_dma_residue); GLOBAL_ALIAS(set_dma_count, get_dma_residue);
GLOBAL_ALIAS(set_dma_addr, get_dma_residue); GLOBAL_ALIAS(__set_dma_addr, get_dma_residue);
GLOBAL_ALIAS(set_dma_sg, get_dma_residue); GLOBAL_ALIAS(set_dma_sg, get_dma_residue);
GLOBAL_ALIAS(set_dma_speed, get_dma_residue); GLOBAL_ALIAS(set_dma_speed, get_dma_residue);
GLOBAL_ALIAS(init_dma, get_dma_residue); GLOBAL_ALIAS(init_dma, get_dma_residue);
...@@ -289,7 +289,7 @@ EXPORT_SYMBOL(request_dma); ...@@ -289,7 +289,7 @@ EXPORT_SYMBOL(request_dma);
EXPORT_SYMBOL(free_dma); EXPORT_SYMBOL(free_dma);
EXPORT_SYMBOL(enable_dma); EXPORT_SYMBOL(enable_dma);
EXPORT_SYMBOL(disable_dma); EXPORT_SYMBOL(disable_dma);
EXPORT_SYMBOL(set_dma_addr); EXPORT_SYMBOL(__set_dma_addr);
EXPORT_SYMBOL(set_dma_count); EXPORT_SYMBOL(set_dma_count);
EXPORT_SYMBOL(set_dma_mode); EXPORT_SYMBOL(set_dma_mode);
EXPORT_SYMBOL(set_dma_page); EXPORT_SYMBOL(set_dma_page);
......
...@@ -91,7 +91,9 @@ extern void set_dma_sg(dmach_t channel, struct scatterlist *sg, int nr_sg); ...@@ -91,7 +91,9 @@ extern void set_dma_sg(dmach_t channel, struct scatterlist *sg, int nr_sg);
* especially since some DMA architectures don't update the * especially since some DMA architectures don't update the
* DMA address immediately, but defer it to the enable_dma(). * DMA address immediately, but defer it to the enable_dma().
*/ */
extern void set_dma_addr(dmach_t channel, unsigned long physaddr); extern void __set_dma_addr(dmach_t channel, void *addr);
#define set_dma_addr(channel, addr) \
__set_dma_addr(channel, bus_to_virt(addr))
/* Set the DMA byte count for this channel /* Set the DMA byte count for this channel
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment