[PATCH 1/2] backport: add stub for of_translate_address() function

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

 



The stub for of_translate_address() was added in 4.4 kernel. Prior to
that it was only available when CONFIG_OF_ADDRESS was selected. So
backport the stub for kernel < 4.4 and !CONFIG_OF_ADDRESS.

Signed-off-by: Arend van Spriel <arend@xxxxxxxxxxxx>
---
 backport/backport-include/linux/of_address.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 backport/backport-include/linux/of_address.h

diff --git a/backport/backport-include/linux/of_address.h b/backport/backport-include/linux/of_address.h
new file mode 100644
index 0000000..63ac79d
--- /dev/null
+++ b/backport/backport-include/linux/of_address.h
@@ -0,0 +1,18 @@
+#ifndef __BACKPORT_OF_ADDRESS_H
+#define __BACKPORT_OF_ADDRESS_H
+#include_next <linux/of_address.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) && !defined(CONFIG_OF_ADDRESS)
+#ifndef OF_BAD_ADDR
+#define OF_BAD_ADDR     ((u64)-1)
+#endif
+#define of_translate_address LINUX_BACKPORT(of_translate_addres)
+static inline u64 of_translate_address(struct device_node *np,
+				       const __be32 *addr)
+{
+	return OF_BAD_ADDR;
+}
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) */
+
+#endif /* __BACKPORT_OF_IRQ_H */
-- 
1.9.1

--
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