Skip to contentSkip to conversation

Replace fdt_node_offset() with fdt_find_node_by_path().

PATCH In review Jerry Van Baren 2 participants 2 messages Jul 5, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 9/17 Replace fdt_node_offset() with fdt_find_node_by_path().

The new name matches more closely the kernel's name, which is also a much better description.

---
 common/cmd_fdt.c     |    2 +-
 common/fdt_support.c |   10 +++++-----
 include/libfdt.h     |    2 +-
 libfdt/fdt_ro.c      |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)
common/cmd_fdt.c +1 -1
index bf0aef7..5a2c3fd 100644
@@ -59,7 +59,7 @@ static int findnodeoffset(const char *pathp)
 	if (strcmp(pathp, "/") == 0) {
 		nodeoffset = 0;
 	} else {
-		nodeoffset = fdt_path_offset (fdt, pathp);
+		nodeoffset = fdt_find_node_by_path (fdt, pathp);
 		if (nodeoffset < 0) {
 			/*
 			 * Not found or something else bad happened.
common/fdt_support.c +5 -5
index 15f133c..efa63f0 100644
@@ -97,7 +97,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
 	/*
 	 * Find the "chosen" node.
 	 */
-	nodeoffset = fdt_path_offset (fdt, "/chosen");
+	nodeoffset = fdt_find_node_by_path (fdt, "/chosen");
 
 	/*
 	 * If we have a "chosen" node already the "force the writing"
@@ -145,7 +145,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
 		printf("WARNING fdt_chosen: could not set \"linux,stdout-path\" (libfdt error %s).\n", fdt_strerror(err));
 #endif
 
-	nodeoffset = fdt_path_offset (fdt, "/cpus");
+	nodeoffset = fdt_find_node_by_path (fdt, "/cpus");
 	if (nodeoffset >= 0) {
 		clock = cpu_to_be32(bd->bi_intfreq);
 		err = fdt_setprop(fdt, nodeoffset, "clock-frequency", &clock, 4);
@@ -153,7 +153,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
 			printf("WARNING fdt_chosen: could not set \"clock-frequency\" (libfdt error %s).\n", fdt_strerror(err));
 	}
 #ifdef OF_TBCLK
-	nodeoffset = fdt_path_offset (fdt, "/cpus/" OF_CPU "/timebase-frequency");
+	nodeoffset = fdt_find_node_by_path (fdt, "/cpus/" OF_CPU "/timebase-frequency");
 	if (nodeoffset >= 0) {
 		clock = cpu_to_be32(OF_TBCLK);
 		err = fdt_setprop(fdt, nodeoffset, "clock-frequency", &clock, 4);
@@ -190,7 +190,7 @@ int fdt_env(void *fdt)
 	 * See if we already have a "u-boot-env" node, delete it if so.
 	 * Then create a new empty node.
 	 */
-	nodeoffset = fdt_path_offset (fdt, "/u-boot-env");
+	nodeoffset = fdt_find_node_by_path (fdt, "/u-boot-env");
 	if (nodeoffset >= 0) {
 		err = fdt_del_node(fdt, nodeoffset);
 		if (err < 0) {
@@ -310,7 +310,7 @@ int fdt_bd_t(void *fdt)
 	 * See if we already have a "bd_t" node, delete it if so.
 	 * Then create a new empty node.
 	 */
-	nodeoffset = fdt_path_offset (fdt, "/bd_t");
+	nodeoffset = fdt_find_node_by_path (fdt, "/bd_t");
 	if (nodeoffset >= 0) {
 		err = fdt_del_node(fdt, nodeoffset);
 		if (err < 0) {
include/libfdt.h +1 -1
index f8bac73..e080028 100644
@@ -77,7 +77,7 @@ int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
 			       const char *name, int namelen);
 int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
 
-int fdt_path_offset(const void *fdt, const char *path);
+int fdt_find_node_by_path(const void *fdt, const char *path);
 
 struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
 				      const char *name, int *lenp);
libfdt/fdt_ro.c +1 -1
index defe59c..1a03109 100644
@@ -132,7 +132,7 @@ int fdt_subnode_offset(const void *fdt, int parentoffset,
  * Searches for the node corresponding to the given path and returns the
  * offset of that node.
  */
-int fdt_path_offset(const void *fdt, const char *path)
+int fdt_find_node_by_path(const void *fdt, const char *path)
 {
 	const char *end = path + strlen(path);
 	const char *p = path;
Signature · 1 line
1.4.4.4
#1 lore raw

PATCH 9/17 Replace fdt_node_offset() with fdt_find_node_by_path().

Quoted 5 lines · Jerry Van Baren

The new name matches more closely the kernel's name, which is also a much better description.

Quoted 109 lines
---
 common/cmd_fdt.c     |    2 +-
 common/fdt_support.c |   10 +++++-----
 include/libfdt.h     |    2 +-
 libfdt/fdt_ro.c      |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)
common/cmd_fdt.c +1 -1
index bf0aef7..5a2c3fd 100644
@@ -59,7 +59,7 @@ static int findnodeoffset(const char *pathp)
        if (strcmp(pathp, "/") == 0) {
                nodeoffset = 0;
        } else {
-               nodeoffset = fdt_path_offset (fdt, pathp);
+               nodeoffset = fdt_find_node_by_path (fdt, pathp);
                if (nodeoffset < 0) {
                        /*
                         * Not found or something else bad happened.
common/fdt_support.c +5 -5
index 15f133c..efa63f0 100644
@@ -97,7 +97,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
        /*
         * Find the "chosen" node.
         */
-       nodeoffset = fdt_path_offset (fdt, "/chosen");
+       nodeoffset = fdt_find_node_by_path (fdt, "/chosen");
 
        /*
         * If we have a "chosen" node already the "force the writing"
@@ -145,7 +145,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
                printf("WARNING fdt_chosen: could not set \"linux,stdout-path\" (libfdt error %s).\n", fdt_strerror(err));
 #endif
 
-       nodeoffset = fdt_path_offset (fdt, "/cpus");
+       nodeoffset = fdt_find_node_by_path (fdt, "/cpus");
        if (nodeoffset >= 0) {
                clock = cpu_to_be32(bd->bi_intfreq);
                err = fdt_setprop(fdt, nodeoffset, "clock-frequency", &clock, 4);
@@ -153,7 +153,7 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
                        printf("WARNING fdt_chosen: could not set \"clock-frequency\" (libfdt error %s).\n", fdt_strerror(err));
        }
 #ifdef OF_TBCLK
-       nodeoffset = fdt_path_offset (fdt, "/cpus/" OF_CPU "/timebase-frequency");
+       nodeoffset = fdt_find_node_by_path (fdt, "/cpus/" OF_CPU "/timebase-frequency");
        if (nodeoffset >= 0) {
                clock = cpu_to_be32(OF_TBCLK);
                err = fdt_setprop(fdt, nodeoffset, "clock-frequency", &clock, 4);
@@ -190,7 +190,7 @@ int fdt_env(void *fdt)
         * See if we already have a "u-boot-env" node, delete it if so.
         * Then create a new empty node.
         */
-       nodeoffset = fdt_path_offset (fdt, "/u-boot-env");
+       nodeoffset = fdt_find_node_by_path (fdt, "/u-boot-env");
        if (nodeoffset >= 0) {
                err = fdt_del_node(fdt, nodeoffset);
                if (err < 0) {
@@ -310,7 +310,7 @@ int fdt_bd_t(void *fdt)
         * See if we already have a "bd_t" node, delete it if so.
         * Then create a new empty node.
         */
-       nodeoffset = fdt_path_offset (fdt, "/bd_t");
+       nodeoffset = fdt_find_node_by_path (fdt, "/bd_t");
        if (nodeoffset >= 0) {
                err = fdt_del_node(fdt, nodeoffset);
                if (err < 0) {
include/libfdt.h +1 -1
index f8bac73..e080028 100644
@@ -77,7 +77,7 @@ int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
                               const char *name, int namelen);
 int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
 
-int fdt_path_offset(const void *fdt, const char *path);
+int fdt_find_node_by_path(const void *fdt, const char *path);
 
 struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
                                      const char *name, int *lenp);
libfdt/fdt_ro.c +1 -2
index defe59c..1a03109 100644
@@ -132,7 +132,7 @@ int fdt_subnode_offset(const void *fdt, int parentoffset,
  * Searches for the node corresponding to the given path and returns the
  * offset of that node.
  */
-int fdt_path_offset(const void *fdt, const char *path)
+int fdt_find_node_by_path(const void *fdt, const char *path)
 {
        const char *end = path + strlen(path);
        const char *p = path;
--

1.4.4.4

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Signature · 4 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195