diff options
| -rw-r--r-- | drivers/base/dma-buf.c | 2 | ||||
| -rw-r--r-- | include/linux/dma-buf.h | 99 |
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 | ||
| 160 | struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, | 159 | struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, |
| 161 | struct device *dev); | 160 | struct device *dev); |
| 162 | void dma_buf_detach(struct dma_buf *dmabuf, | 161 | void 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); |
| 185 | void *dma_buf_vmap(struct dma_buf *); | 184 | void *dma_buf_vmap(struct dma_buf *); |
| 186 | void dma_buf_vunmap(struct dma_buf *, void *vaddr); | 185 | void dma_buf_vunmap(struct dma_buf *, void *vaddr); |
| 187 | #else | ||
| 188 | |||
| 189 | static inline struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, | ||
| 190 | struct device *dev) | ||
| 191 | { | ||
| 192 | return ERR_PTR(-ENODEV); | ||
| 193 | } | ||
| 194 | |||
| 195 | static inline void dma_buf_detach(struct dma_buf *dmabuf, | ||
| 196 | struct dma_buf_attachment *dmabuf_attach) | ||
| 197 | { | ||
| 198 | return; | ||
| 199 | } | ||
| 200 | |||
| 201 | static 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 | |||
| 208 | static inline int dma_buf_fd(struct dma_buf *dmabuf, int flags) | ||
| 209 | { | ||
| 210 | return -ENODEV; | ||
| 211 | } | ||
| 212 | |||
| 213 | static inline struct dma_buf *dma_buf_get(int fd) | ||
| 214 | { | ||
| 215 | return ERR_PTR(-ENODEV); | ||
| 216 | } | ||
| 217 | |||
| 218 | static inline void dma_buf_put(struct dma_buf *dmabuf) | ||
| 219 | { | ||
| 220 | return; | ||
| 221 | } | ||
| 222 | |||
| 223 | static 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 | |||
| 229 | static 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 | |||
| 235 | static 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 | |||
| 242 | static 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 | |||
| 248 | static inline void *dma_buf_kmap_atomic(struct dma_buf *dmabuf, | ||
| 249 | unsigned long pnum) | ||
| 250 | { | ||
| 251 | return NULL; | ||
| 252 | } | ||
| 253 | |||
| 254 | static inline void dma_buf_kunmap_atomic(struct dma_buf *dmabuf, | ||
| 255 | unsigned long pnum, void *vaddr) | ||
| 256 | { | ||
| 257 | } | ||
| 258 | |||
| 259 | static inline void *dma_buf_kmap(struct dma_buf *dmabuf, unsigned long pnum) | ||
| 260 | { | ||
| 261 | return NULL; | ||
| 262 | } | ||
| 263 | |||
| 264 | static inline void dma_buf_kunmap(struct dma_buf *dmabuf, | ||
| 265 | unsigned long pnum, void *vaddr) | ||
| 266 | { | ||
| 267 | } | ||
| 268 | |||
| 269 | static 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 | |||
| 276 | static inline void *dma_buf_vmap(struct dma_buf *dmabuf) | ||
| 277 | { | ||
| 278 | return NULL; | ||
| 279 | } | ||
| 280 | |||
| 281 | static 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__ */ |
