summaryrefslogtreecommitdiff
path: root/backport
diff options
context:
space:
mode:
Diffstat (limited to 'backport')
-rw-r--r--backport/backport-include/linux/of_device.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/backport/backport-include/linux/of_device.h b/backport/backport-include/linux/of_device.h
index 951b2534..cdd366e3 100644
--- a/backport/backport-include/linux/of_device.h
+++ b/backport/backport-include/linux/of_device.h
@@ -3,9 +3,24 @@
#include_next <linux/of_device.h>
#include <linux/version.h>
-#if LINUX_VERSION_IS_LESS(4,1,0)
-static inline void of_dma_configure(struct device *dev, struct device_node *np)
-{}
-#endif /* < 4.1.0 */
+#if LINUX_VERSION_IS_LESS(4,18,0)
+static inline int backport_of_dma_configure(struct device *dev,
+ struct device_node *np,
+ bool force_dma)
+{
+#if LINUX_VERSION_IS_GEQ(4,15,0)
+ dev->bus->force_dma = force_dma;
+ return of_dma_configure(dev, np);
+#elif LINUX_VERSION_IS_GEQ(4,12,0)
+ return of_dma_configure(dev, np);
+#elif LINUX_VERSION_IS_GEQ(4,1,0)
+ of_dma_configure(dev, np);
+ return 0;
+#else
+ return 0;
+#endif
+}
+#define of_dma_configure LINUX_BACKPORT(of_dma_configure)
+#endif /* < 4.18 */
#endif /* __BP_OF_DEVICE_H */