[PATCH] backports: Add 3. parameter to of_dma_configure()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


With commit 3d6ce86ee794 ("drivers: remove force dma flag from buses")
in kernel 4.18 of_dma_configure() got the extra parameter force_dma.
This is backported by setting the force_dma member which was added in
commit d89e2378a97f ("drivers: flag buses which demand DMA
configuration") in kernel 4.15.
In older kernel versions we just ignore this parameter as the
of_dma_configure() function internally takes care of setting this
Since commit 7b07cbefb68d ("iommu: of: Handle IOMMU lookup failure with
deferred probing or error") in kernel 4.12 this function returns int and
not void any more.

Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
 backport/backport-include/linux/of_device.h | 23 +++++++++++++++++++----
 1 file 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>
-static inline void of_dma_configure(struct device *dev, struct device_node *np)
-#endif /* < 4.1.0 */
+static inline int backport_of_dma_configure(struct device *dev,
+					    struct device_node *np,
+					    bool force_dma)
+	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;
+	return 0;
+#define of_dma_configure LINUX_BACKPORT(of_dma_configure)
+#endif /* < 4.18 */
 #endif /* __BP_OF_DEVICE_H */

To unsubscribe from this list: send the line "unsubscribe backports" in

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux