aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-20 10:18:29 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-20 10:18:29 -0500
commitddedec28b1d5144bc2c765d97003997f3505fd3a (patch)
tree3faaa84beca03b4e6dae3f7da7bf0bd681b45c9d
parent8cb68bdf76a356662fda44a2af04b505b17c1b56 (diff)
parentada65c74059f8c104f1b467c126205471634c435 (diff)
Merge tag 'tag-for-linus-3.8' of git://git.linaro.org/people/sumitsemwal/linux-dma-buf
Pull dma-buf updates from Sumit Semwal: "A fairly small dma-buf pull request for 3.8 - only 2 patches" * tag 'tag-for-linus-3.8' of git://git.linaro.org/people/sumitsemwal/linux-dma-buf: dma-buf: remove fallback for !CONFIG_DMA_SHARED_BUFFER dma-buf: might_sleep() in dma_buf_unmap_attachment()
-rw-r--r--drivers/base/dma-buf.c2
-rw-r--r--include/linux/dma-buf.h99
2 files changed, 2 insertions, 99 deletions
diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
index 460e22dee36d..a3f79c495a41 100644
--- a/drivers/base/dma-buf.c
+++ b/drivers/base/dma-buf.c
@@ -298,6 +298,8 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach,
298 struct sg_table *sg_table, 298 struct sg_table *sg_table,
299 enum dma_data_direction direction) 299 enum dma_data_direction direction)
300{ 300{
301 might_sleep();
302
301 if (WARN_ON(!attach || !attach->dmabuf || !sg_table)) 303 if (WARN_ON(!attach || !attach->dmabuf || !sg_table))
302 return; 304 return;
303 305
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
index eb48f3816df9..bd2e52ccc4f2 100644
--- a/include/linux/dma-buf.h
+++ b/include/linux/dma-buf.h
@@ -156,7 +156,6 @@ static inline void get_dma_buf(struct dma_buf *dmabuf)
156 get_file(dmabuf->file); 156 get_file(dmabuf->file);
157} 157}
158 158
159#ifdef CONFIG_DMA_SHARED_BUFFER
160struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, 159struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
161 struct device *dev); 160 struct device *dev);
162void dma_buf_detach(struct dma_buf *dmabuf, 161void dma_buf_detach(struct dma_buf *dmabuf,
@@ -184,103 +183,5 @@ int dma_buf_mmap(struct dma_buf *, struct vm_area_struct *,
184 unsigned long); 183 unsigned long);
185void *dma_buf_vmap(struct dma_buf *); 184void *dma_buf_vmap(struct dma_buf *);
186void dma_buf_vunmap(struct dma_buf *, void *vaddr); 185void dma_buf_vunmap(struct dma_buf *, void *vaddr);
187#else
188
189static inline struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
190 struct device *dev)
191{
192 return ERR_PTR(-ENODEV);
193}
194
195static inline void dma_buf_detach(struct dma_buf *dmabuf,
196 struct dma_buf_attachment *dmabuf_attach)
197{
198 return;
199}
200
201static inline struct dma_buf *dma_buf_export(void *priv,
202 const struct dma_buf_ops *ops,
203 size_t size, int flags)
204{
205 return ERR_PTR(-ENODEV);
206}
207
208static inline int dma_buf_fd(struct dma_buf *dmabuf, int flags)
209{
210 return -ENODEV;
211}
212
213static inline struct dma_buf *dma_buf_get(int fd)
214{
215 return ERR_PTR(-ENODEV);
216}
217
218static inline void dma_buf_put(struct dma_buf *dmabuf)
219{
220 return;
221}
222
223static inline struct sg_table *dma_buf_map_attachment(
224 struct dma_buf_attachment *attach, enum dma_data_direction write)
225{
226 return ERR_PTR(-ENODEV);
227}
228
229static inline void dma_buf_unmap_attachment(struct dma_buf_attachment *attach,
230 struct sg_table *sg, enum dma_data_direction dir)
231{
232 return;
233}
234
235static inline int dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
236 size_t start, size_t len,
237 enum dma_data_direction dir)
238{
239 return -ENODEV;
240}
241
242static inline void dma_buf_end_cpu_access(struct dma_buf *dmabuf,
243 size_t start, size_t len,
244 enum dma_data_direction dir)
245{
246}
247
248static inline void *dma_buf_kmap_atomic(struct dma_buf *dmabuf,
249 unsigned long pnum)
250{
251 return NULL;
252}
253
254static inline void dma_buf_kunmap_atomic(struct dma_buf *dmabuf,
255 unsigned long pnum, void *vaddr)
256{
257}
258
259static inline void *dma_buf_kmap(struct dma_buf *dmabuf, unsigned long pnum)
260{
261 return NULL;
262}
263
264static inline void dma_buf_kunmap(struct dma_buf *dmabuf,
265 unsigned long pnum, void *vaddr)
266{
267}
268
269static inline int dma_buf_mmap(struct dma_buf *dmabuf,
270 struct vm_area_struct *vma,
271 unsigned long pgoff)
272{
273 return -ENODEV;
274}
275
276static inline void *dma_buf_vmap(struct dma_buf *dmabuf)
277{
278 return NULL;
279}
280
281static inline void dma_buf_vunmap(struct dma_buf *dmabuf, void *vaddr)
282{
283}
284#endif /* CONFIG_DMA_SHARED_BUFFER */
285 186
286#endif /* __DMA_BUF_H__ */ 187#endif /* __DMA_BUF_H__ */