Skip to content

Commit

Permalink
sh/sh64: fixup dma-mapping for new sg layout
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Jens Axboe committed Oct 23, 2007
1 parent ebc3bbc commit 71df50a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
12 changes: 5 additions & 7 deletions include/asm-sh/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define __ASM_SH_DMA_MAPPING_H

#include <linux/mm.h>
#include <asm/scatterlist.h>
#include <linux/scatterlist.h>
#include <asm/cacheflush.h>
#include <asm/io.h>

Expand Down Expand Up @@ -85,10 +85,9 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,

for (i = 0; i < nents; i++) {
#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
sg[i].length, dir);
dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
#endif
sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
sg[i].dma_address = sg_phys(&sg[i]);
}

return nents;
Expand Down Expand Up @@ -138,10 +137,9 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,

for (i = 0; i < nelems; i++) {
#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
sg[i].length, dir);
dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
#endif
sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
sg[i].dma_address = sg_phys(&sg[i]);
}
}

Expand Down
12 changes: 5 additions & 7 deletions include/asm-sh64/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define __ASM_SH_DMA_MAPPING_H

#include <linux/mm.h>
#include <asm/scatterlist.h>
#include <linux/scatterlist.h>
#include <asm/io.h>

struct pci_dev;
Expand Down Expand Up @@ -71,10 +71,9 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,

for (i = 0; i < nents; i++) {
#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
sg[i].length, dir);
dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
#endif
sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
sg[i].dma_address = sg_phys(&sg[i]);
}

return nents;
Expand Down Expand Up @@ -124,10 +123,9 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,

for (i = 0; i < nelems; i++) {
#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
sg[i].length, dir);
dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
#endif
sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
sg[i].dma_address = sg_phys(&sg[i]);
}
}

Expand Down

0 comments on commit 71df50a

Please sign in to comment.