[PATCH 04/20] linux/of.h: Add of_n_addr_cells()

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jan 19 13:53:54 UTC 2018


---
 rtemsbsd/powerpc/include/linux/of.h | 2 ++
 rtemsbsd/sys/powerpc/compat.c       | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/rtemsbsd/powerpc/include/linux/of.h b/rtemsbsd/powerpc/include/linux/of.h
index f7f6f6ecb..001a0c80e 100644
--- a/rtemsbsd/powerpc/include/linux/of.h
+++ b/rtemsbsd/powerpc/include/linux/of.h
@@ -59,6 +59,8 @@ of_node_put(struct device_node *dn)
 const void *of_get_property(const struct device_node *dn, const char *name,
     int *len);
 
+int of_n_addr_cells(struct device_node *dn);
+
 /* FIXME: If we need the property, then more work is to do */
 #define	of_find_property(dn, name, len) of_get_property(dn, name, len)
 
diff --git a/rtemsbsd/sys/powerpc/compat.c b/rtemsbsd/sys/powerpc/compat.c
index 7a9dd955a..1f9eb9893 100644
--- a/rtemsbsd/sys/powerpc/compat.c
+++ b/rtemsbsd/sys/powerpc/compat.c
@@ -205,6 +205,13 @@ get_size_cells(const void *fdt, int node)
 }
 
 int
+of_n_addr_cells(struct device_node *dn)
+{
+
+	return (get_address_cells(bsp_fdt_get(), dn->offset));
+}
+
+int
 of_address_to_resource(struct device_node *dn, int index,
     struct resource *res)
 {
-- 
2.12.3




More information about the devel mailing list