[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-backports
Subject:    [PATCH 1/2] backport: add stub for of_translate_address() function
From:       Arend van Spriel <arend () broadcom ! com>
Date:       2016-04-01 8:33:38
Message-ID: 1459499619-16641-1-git-send-email-arend () broadcom ! com
[Download RAW message or body]

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@broadcom.com>
---
 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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic