diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2011-12-22 07:58:21 -0500 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2012-03-28 10:36:36 -0400 |
commit | 4ce9a91f344d08640ea6e9a6eba0c1b4641ab6a1 (patch) | |
tree | 7e384975c15461996a5772f893658911d42b6667 /arch/alpha | |
parent | c416258a6e1e68a33fd328e872007d19941138c5 (diff) |
Alpha: adapt for dma_map_ops changes
Adapt core Alpha architecture code for dma_map_ops changes: replace
alloc/free_coherent with generic alloc/free methods.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'arch/alpha')
-rw-r--r-- | arch/alpha/include/asm/dma-mapping.h | 18 | ||||
-rw-r--r-- | arch/alpha/kernel/pci-noop.c | 10 | ||||
-rw-r--r-- | arch/alpha/kernel/pci_iommu.c | 10 |
3 files changed, 24 insertions, 14 deletions
diff --git a/arch/alpha/include/asm/dma-mapping.h b/arch/alpha/include/asm/dma-mapping.h index 4567aca6fdd6..dfa32f061320 100644 --- a/arch/alpha/include/asm/dma-mapping.h +++ b/arch/alpha/include/asm/dma-mapping.h | |||
@@ -12,16 +12,22 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev) | |||
12 | 12 | ||
13 | #include <asm-generic/dma-mapping-common.h> | 13 | #include <asm-generic/dma-mapping-common.h> |
14 | 14 | ||
15 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 15 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) |
16 | dma_addr_t *dma_handle, gfp_t gfp) | 16 | |
17 | static inline void *dma_alloc_attrs(struct device *dev, size_t size, | ||
18 | dma_addr_t *dma_handle, gfp_t gfp, | ||
19 | struct dma_attrs *attrs) | ||
17 | { | 20 | { |
18 | return get_dma_ops(dev)->alloc_coherent(dev, size, dma_handle, gfp); | 21 | return get_dma_ops(dev)->alloc(dev, size, dma_handle, gfp, attrs); |
19 | } | 22 | } |
20 | 23 | ||
21 | static inline void dma_free_coherent(struct device *dev, size_t size, | 24 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) |
22 | void *vaddr, dma_addr_t dma_handle) | 25 | |
26 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
27 | void *vaddr, dma_addr_t dma_handle, | ||
28 | struct dma_attrs *attrs) | ||
23 | { | 29 | { |
24 | get_dma_ops(dev)->free_coherent(dev, size, vaddr, dma_handle); | 30 | get_dma_ops(dev)->free(dev, size, vaddr, dma_handle, attrs); |
25 | } | 31 | } |
26 | 32 | ||
27 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | 33 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
diff --git a/arch/alpha/kernel/pci-noop.c b/arch/alpha/kernel/pci-noop.c index 04eea4894ef3..df24b76f9246 100644 --- a/arch/alpha/kernel/pci-noop.c +++ b/arch/alpha/kernel/pci-noop.c | |||
@@ -108,7 +108,8 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn, | |||
108 | } | 108 | } |
109 | 109 | ||
110 | static void *alpha_noop_alloc_coherent(struct device *dev, size_t size, | 110 | static void *alpha_noop_alloc_coherent(struct device *dev, size_t size, |
111 | dma_addr_t *dma_handle, gfp_t gfp) | 111 | dma_addr_t *dma_handle, gfp_t gfp, |
112 | struct dma_attrs *attrs) | ||
112 | { | 113 | { |
113 | void *ret; | 114 | void *ret; |
114 | 115 | ||
@@ -123,7 +124,8 @@ static void *alpha_noop_alloc_coherent(struct device *dev, size_t size, | |||
123 | } | 124 | } |
124 | 125 | ||
125 | static void alpha_noop_free_coherent(struct device *dev, size_t size, | 126 | static void alpha_noop_free_coherent(struct device *dev, size_t size, |
126 | void *cpu_addr, dma_addr_t dma_addr) | 127 | void *cpu_addr, dma_addr_t dma_addr, |
128 | struct dma_attrs *attrs) | ||
127 | { | 129 | { |
128 | free_pages((unsigned long)cpu_addr, get_order(size)); | 130 | free_pages((unsigned long)cpu_addr, get_order(size)); |
129 | } | 131 | } |
@@ -174,8 +176,8 @@ static int alpha_noop_set_mask(struct device *dev, u64 mask) | |||
174 | } | 176 | } |
175 | 177 | ||
176 | struct dma_map_ops alpha_noop_ops = { | 178 | struct dma_map_ops alpha_noop_ops = { |
177 | .alloc_coherent = alpha_noop_alloc_coherent, | 179 | .alloc = alpha_noop_alloc_coherent, |
178 | .free_coherent = alpha_noop_free_coherent, | 180 | .free = alpha_noop_free_coherent, |
179 | .map_page = alpha_noop_map_page, | 181 | .map_page = alpha_noop_map_page, |
180 | .map_sg = alpha_noop_map_sg, | 182 | .map_sg = alpha_noop_map_sg, |
181 | .mapping_error = alpha_noop_mapping_error, | 183 | .mapping_error = alpha_noop_mapping_error, |
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c index 43610804987d..cd634795aa9c 100644 --- a/arch/alpha/kernel/pci_iommu.c +++ b/arch/alpha/kernel/pci_iommu.c | |||
@@ -434,7 +434,8 @@ static void alpha_pci_unmap_page(struct device *dev, dma_addr_t dma_addr, | |||
434 | else DMA_ADDRP is undefined. */ | 434 | else DMA_ADDRP is undefined. */ |
435 | 435 | ||
436 | static void *alpha_pci_alloc_coherent(struct device *dev, size_t size, | 436 | static void *alpha_pci_alloc_coherent(struct device *dev, size_t size, |
437 | dma_addr_t *dma_addrp, gfp_t gfp) | 437 | dma_addr_t *dma_addrp, gfp_t gfp, |
438 | struct dma_attrs *attrs) | ||
438 | { | 439 | { |
439 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); | 440 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); |
440 | void *cpu_addr; | 441 | void *cpu_addr; |
@@ -478,7 +479,8 @@ try_again: | |||
478 | DMA_ADDR past this call are illegal. */ | 479 | DMA_ADDR past this call are illegal. */ |
479 | 480 | ||
480 | static void alpha_pci_free_coherent(struct device *dev, size_t size, | 481 | static void alpha_pci_free_coherent(struct device *dev, size_t size, |
481 | void *cpu_addr, dma_addr_t dma_addr) | 482 | void *cpu_addr, dma_addr_t dma_addr, |
483 | struct dma_attrs *attrs) | ||
482 | { | 484 | { |
483 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); | 485 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); |
484 | pci_unmap_single(pdev, dma_addr, size, PCI_DMA_BIDIRECTIONAL); | 486 | pci_unmap_single(pdev, dma_addr, size, PCI_DMA_BIDIRECTIONAL); |
@@ -952,8 +954,8 @@ static int alpha_pci_set_mask(struct device *dev, u64 mask) | |||
952 | } | 954 | } |
953 | 955 | ||
954 | struct dma_map_ops alpha_pci_ops = { | 956 | struct dma_map_ops alpha_pci_ops = { |
955 | .alloc_coherent = alpha_pci_alloc_coherent, | 957 | .alloc = alpha_pci_alloc_coherent, |
956 | .free_coherent = alpha_pci_free_coherent, | 958 | .free = alpha_pci_free_coherent, |
957 | .map_page = alpha_pci_map_page, | 959 | .map_page = alpha_pci_map_page, |
958 | .unmap_page = alpha_pci_unmap_page, | 960 | .unmap_page = alpha_pci_unmap_page, |
959 | .map_sg = alpha_pci_map_sg, | 961 | .map_sg = alpha_pci_map_sg, |