diff options
Diffstat (limited to 'include/linux/pci-dma-compat.h')
-rw-r--r-- | include/linux/pci-dma-compat.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/include/linux/pci-dma-compat.h b/include/linux/pci-dma-compat.h index d1f9fdade1e0..0dd1a3f7b309 100644 --- a/include/linux/pci-dma-compat.h +++ b/include/linux/pci-dma-compat.h | |||
@@ -17,91 +17,90 @@ static inline void * | |||
17 | pci_alloc_consistent(struct pci_dev *hwdev, size_t size, | 17 | pci_alloc_consistent(struct pci_dev *hwdev, size_t size, |
18 | dma_addr_t *dma_handle) | 18 | dma_addr_t *dma_handle) |
19 | { | 19 | { |
20 | return dma_alloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, dma_handle, GFP_ATOMIC); | 20 | return dma_alloc_coherent(&hwdev->dev, size, dma_handle, GFP_ATOMIC); |
21 | } | 21 | } |
22 | 22 | ||
23 | static inline void * | 23 | static inline void * |
24 | pci_zalloc_consistent(struct pci_dev *hwdev, size_t size, | 24 | pci_zalloc_consistent(struct pci_dev *hwdev, size_t size, |
25 | dma_addr_t *dma_handle) | 25 | dma_addr_t *dma_handle) |
26 | { | 26 | { |
27 | return dma_zalloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, | 27 | return dma_zalloc_coherent(&hwdev->dev, size, dma_handle, GFP_ATOMIC); |
28 | size, dma_handle, GFP_ATOMIC); | ||
29 | } | 28 | } |
30 | 29 | ||
31 | static inline void | 30 | static inline void |
32 | pci_free_consistent(struct pci_dev *hwdev, size_t size, | 31 | pci_free_consistent(struct pci_dev *hwdev, size_t size, |
33 | void *vaddr, dma_addr_t dma_handle) | 32 | void *vaddr, dma_addr_t dma_handle) |
34 | { | 33 | { |
35 | dma_free_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, vaddr, dma_handle); | 34 | dma_free_coherent(&hwdev->dev, size, vaddr, dma_handle); |
36 | } | 35 | } |
37 | 36 | ||
38 | static inline dma_addr_t | 37 | static inline dma_addr_t |
39 | pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) | 38 | pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) |
40 | { | 39 | { |
41 | return dma_map_single(hwdev == NULL ? NULL : &hwdev->dev, ptr, size, (enum dma_data_direction)direction); | 40 | return dma_map_single(&hwdev->dev, ptr, size, (enum dma_data_direction)direction); |
42 | } | 41 | } |
43 | 42 | ||
44 | static inline void | 43 | static inline void |
45 | pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, | 44 | pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, |
46 | size_t size, int direction) | 45 | size_t size, int direction) |
47 | { | 46 | { |
48 | dma_unmap_single(hwdev == NULL ? NULL : &hwdev->dev, dma_addr, size, (enum dma_data_direction)direction); | 47 | dma_unmap_single(&hwdev->dev, dma_addr, size, (enum dma_data_direction)direction); |
49 | } | 48 | } |
50 | 49 | ||
51 | static inline dma_addr_t | 50 | static inline dma_addr_t |
52 | pci_map_page(struct pci_dev *hwdev, struct page *page, | 51 | pci_map_page(struct pci_dev *hwdev, struct page *page, |
53 | unsigned long offset, size_t size, int direction) | 52 | unsigned long offset, size_t size, int direction) |
54 | { | 53 | { |
55 | return dma_map_page(hwdev == NULL ? NULL : &hwdev->dev, page, offset, size, (enum dma_data_direction)direction); | 54 | return dma_map_page(&hwdev->dev, page, offset, size, (enum dma_data_direction)direction); |
56 | } | 55 | } |
57 | 56 | ||
58 | static inline void | 57 | static inline void |
59 | pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address, | 58 | pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address, |
60 | size_t size, int direction) | 59 | size_t size, int direction) |
61 | { | 60 | { |
62 | dma_unmap_page(hwdev == NULL ? NULL : &hwdev->dev, dma_address, size, (enum dma_data_direction)direction); | 61 | dma_unmap_page(&hwdev->dev, dma_address, size, (enum dma_data_direction)direction); |
63 | } | 62 | } |
64 | 63 | ||
65 | static inline int | 64 | static inline int |
66 | pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, | 65 | pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, |
67 | int nents, int direction) | 66 | int nents, int direction) |
68 | { | 67 | { |
69 | return dma_map_sg(hwdev == NULL ? NULL : &hwdev->dev, sg, nents, (enum dma_data_direction)direction); | 68 | return dma_map_sg(&hwdev->dev, sg, nents, (enum dma_data_direction)direction); |
70 | } | 69 | } |
71 | 70 | ||
72 | static inline void | 71 | static inline void |
73 | pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, | 72 | pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, |
74 | int nents, int direction) | 73 | int nents, int direction) |
75 | { | 74 | { |
76 | dma_unmap_sg(hwdev == NULL ? NULL : &hwdev->dev, sg, nents, (enum dma_data_direction)direction); | 75 | dma_unmap_sg(&hwdev->dev, sg, nents, (enum dma_data_direction)direction); |
77 | } | 76 | } |
78 | 77 | ||
79 | static inline void | 78 | static inline void |
80 | pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t dma_handle, | 79 | pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t dma_handle, |
81 | size_t size, int direction) | 80 | size_t size, int direction) |
82 | { | 81 | { |
83 | dma_sync_single_for_cpu(hwdev == NULL ? NULL : &hwdev->dev, dma_handle, size, (enum dma_data_direction)direction); | 82 | dma_sync_single_for_cpu(&hwdev->dev, dma_handle, size, (enum dma_data_direction)direction); |
84 | } | 83 | } |
85 | 84 | ||
86 | static inline void | 85 | static inline void |
87 | pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t dma_handle, | 86 | pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t dma_handle, |
88 | size_t size, int direction) | 87 | size_t size, int direction) |
89 | { | 88 | { |
90 | dma_sync_single_for_device(hwdev == NULL ? NULL : &hwdev->dev, dma_handle, size, (enum dma_data_direction)direction); | 89 | dma_sync_single_for_device(&hwdev->dev, dma_handle, size, (enum dma_data_direction)direction); |
91 | } | 90 | } |
92 | 91 | ||
93 | static inline void | 92 | static inline void |
94 | pci_dma_sync_sg_for_cpu(struct pci_dev *hwdev, struct scatterlist *sg, | 93 | pci_dma_sync_sg_for_cpu(struct pci_dev *hwdev, struct scatterlist *sg, |
95 | int nelems, int direction) | 94 | int nelems, int direction) |
96 | { | 95 | { |
97 | dma_sync_sg_for_cpu(hwdev == NULL ? NULL : &hwdev->dev, sg, nelems, (enum dma_data_direction)direction); | 96 | dma_sync_sg_for_cpu(&hwdev->dev, sg, nelems, (enum dma_data_direction)direction); |
98 | } | 97 | } |
99 | 98 | ||
100 | static inline void | 99 | static inline void |
101 | pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sg, | 100 | pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sg, |
102 | int nelems, int direction) | 101 | int nelems, int direction) |
103 | { | 102 | { |
104 | dma_sync_sg_for_device(hwdev == NULL ? NULL : &hwdev->dev, sg, nelems, (enum dma_data_direction)direction); | 103 | dma_sync_sg_for_device(&hwdev->dev, sg, nelems, (enum dma_data_direction)direction); |
105 | } | 104 | } |
106 | 105 | ||
107 | static inline int | 106 | static inline int |