Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3fa72e4 authored by Ralf Baechle's avatar Ralf Baechle Committed by Linus Torvalds
Browse files

[PATCH] Pass struct dev pointer to dma_cache_sync()



Pass struct dev pointer to dma_cache_sync()

dma_cache_sync() is ill-designed in that it does not have a struct device
pointer argument which makes proper support for systems that consist of a
mix of coherent and non-coherent DMA devices hard.  Change dma_cache_sync
to take a struct device pointer as first argument and fix all its callers
to pass it.

Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f67637ee
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -459,7 +459,7 @@ anything like this. You must also be extra careful about accessing
memory you intend to sync partially.
memory you intend to sync partially.


void
void
dma_cache_sync(void *vaddr, size_t size,
dma_cache_sync(struct device *dev, void *vaddr, size_t size,
	       enum dma_data_direction direction)
	       enum dma_data_direction direction)


Do a partial sync of memory that was allocated by
Do a partial sync of memory that was allocated by
+1 −1
Original line number Original line Diff line number Diff line
@@ -11,7 +11,7 @@
#include <asm/addrspace.h>
#include <asm/addrspace.h>
#include <asm/cacheflush.h>
#include <asm/cacheflush.h>


void dma_cache_sync(void *vaddr, size_t size, int direction)
void dma_cache_sync(struct device *dev, void *vaddr, size_t size, int direction)
{
{
	/*
	/*
	 * No need to sync an uncached area
	 * No need to sync an uncached area
+1 −1
Original line number Original line Diff line number Diff line
@@ -197,7 +197,7 @@ int dma_is_consistent(struct device *dev, dma_addr_t dma_addr)


EXPORT_SYMBOL(dma_is_consistent);
EXPORT_SYMBOL(dma_is_consistent);


void dma_cache_sync(void *vaddr, size_t size,
void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
	       enum dma_data_direction direction)
	       enum dma_data_direction direction)
{
{
	BUG_ON(direction == DMA_NONE);
	BUG_ON(direction == DMA_NONE);
+1 −1
Original line number Original line Diff line number Diff line
@@ -204,7 +204,7 @@ int dma_is_consistent(struct device *dev, dma_addr_t dma_addr)


EXPORT_SYMBOL(dma_is_consistent);
EXPORT_SYMBOL(dma_is_consistent);


void dma_cache_sync(void *vaddr, size_t size,
void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
	       enum dma_data_direction direction)
	       enum dma_data_direction direction)
{
{
	BUG_ON(direction == DMA_NONE);
	BUG_ON(direction == DMA_NONE);
+2 −1
Original line number Original line Diff line number Diff line
@@ -370,7 +370,8 @@ int dma_is_consistent(struct device *dev, dma_addr_t dma_addr)


EXPORT_SYMBOL(dma_is_consistent);
EXPORT_SYMBOL(dma_is_consistent);


void dma_cache_sync(void *vaddr, size_t size, enum dma_data_direction direction)
void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
	enum dma_data_direction direction)
{
{
	if (direction == DMA_NONE)
	if (direction == DMA_NONE)
		return;
		return;
Loading