summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2015-04-27 23:19:15 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2015-04-28 23:32:15 +0200
commit2f8597bd3e2c404d5c8f0ec74fa49e78b698e373 (patch)
tree9d867622913d4c757e6271e1a76de6c7ec2a78e2
parent2745ccd4fd5bd5d60d3f761e1bae0617b625ae71 (diff)
Revert "header: adapt new dma_buf_export() signature"
This change is only needed for kernel 4.1 and later and not for 4.0. This reverts commit 1adc4bb782a411b29f4f6ddc9b3ddbe081b7bacb. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--backport/backport-include/linux/dma-buf.h48
1 files changed, 7 insertions, 41 deletions
diff --git a/backport/backport-include/linux/dma-buf.h b/backport/backport-include/linux/dma-buf.h
index 07ac0b4a..48c2ebf5 100644
--- a/backport/backport-include/linux/dma-buf.h
+++ b/backport/backport-include/linux/dma-buf.h
@@ -8,47 +8,13 @@
#include <linux/dma-attrs.h>
#include <linux/dma-mapping.h>
-#if !defined(DEFINE_DMA_BUF_EXPORT_INFO) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
-/**
- * helper macro for exporters; zeros and fills in most common values
- */
-#define DEFINE_DMA_BUF_EXPORT_INFO(a) \
- struct dma_buf_export_info a = { .exp_name = KBUILD_MODNAME }
-
-struct dma_buf_export_info {
- const char *exp_name;
- const struct dma_buf_ops *ops;
- size_t size;
- int flags;
- struct reservation_object *resv;
- void *priv;
-};
-
-#ifdef dma_buf_export
-#undef dma_buf_export
-#endif
-
-static inline
-struct dma_buf *backport_dma_buf_export(const struct dma_buf_export_info *exp_info)
-{
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
- return dma_buf_export(exp_info->priv,
- (struct dma_buf_ops *)exp_info->ops,
- exp_info->size, exp_info->flags);
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
- return dma_buf_export(exp_info->priv, exp_info->ops,
- exp_info->size, exp_info->flags);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+#define dma_buf_export(priv, ops, size, flags, resv) \
+ dma_buf_export(priv, ops, size, flags)
#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
- return dma_buf_export_named(exp_info->priv, exp_info->ops,
- exp_info->size, exp_info->flags,
- exp_info->exp_name);
-#else
- return dma_buf_export_named(exp_info->priv, exp_info->ops,
- exp_info->size, exp_info->flags,
- exp_info->exp_name, exp_info->resv);
-#endif
-}
-#define dma_buf_export LINUX_BACKPORT(dma_buf_export)
-#endif /* !defined(DEFINE_DMA_BUF_EXPORT_INFO) */
+#undef dma_buf_export
+#define dma_buf_export(priv, ops, size, flags, resv) \
+ dma_buf_export_named(priv, ops, size, flags, KBUILD_MODNAME)
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0) */
#endif /* _BACKPORT_DMA_BUF_H__ */