[rtems-libbsd commit] linux/of.h: Add of_n_addr_cells()

Sebastian Huber sebh at rtems.org
Tue Jan 23 13:57:23 UTC 2018


Module:    rtems-libbsd
Branch:    master
Commit:    0d421d850eea96c817aa6e9c5a4f734ff0c94bfa
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=0d421d850eea96c817aa6e9c5a4f734ff0c94bfa

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Jan 17 14:13:34 2018 +0100

linux/of.h: Add of_n_addr_cells()

Update #3277.

---

 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 f7f6f6e..001a0c8 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 7a9dd95..1f9eb98 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)
 {



More information about the vc mailing list