Removed some nonused fdt functions and moved fdt_find_and_setprop out of libfdt
RFC PATCH 1/2 Removed some nonused fdt functions and moved fdt_find_and_setprop out of libfdt
Removed:
fdt_node_is_compatible
fdt_find_node_by_type
fdt_find_compatible_node
To ease merge of newer libfdt as we aren't using them anywhere at this time.
Also moved fdt_find_and_setprop out of libfdt into fdt_support.c for the same reason.
---
(Post here as a start towards import of updated libfdt)
common/fdt_support.c | 26 ++++++++++++ include/libfdt.h | 6 --- libfdt/fdt_ro.c | 112 -------------------------------------------------- libfdt/fdt_rw.c | 26 ------------ 4 files changed, 26 insertions(+), 144 deletions(-)
common/fdt_support.c +26 -0
@@ -44,6 +44,32 @@ struct fdt_header *fdt;/********************************************************************/ +/** +* fdt_find_and_setprop: Find a node and set it's property +* +* @fdt: ptr to device tree +* @node: path of node +* @prop: property name +* @val: ptr to new value +* @len: length of new property value +* @create: flag to create the property if it doesn't exist +* +* Convenience function to directly set a property given the path to the node. +*/ +int fdt_find_and_setprop (void *fdt,const char *node,const char *prop, +const void *val,int len,int create) +{ +int nodeoff =fdt_find_node_by_path (fdt, node); + +if (nodeoff <0 ) +return nodeoff; + +if ((!create) && (fdt_get_property (fdt, nodeoff, prop,0 ) ==NULL )) +return 0 ;/* create flag not set; so exit quietly */ + +return fdt_setprop (fdt, nodeoff, prop, val, len); +} +int fdt_chosen (void *fdt,ulong initrd_start,ulong initrd_end,int force) {int nodeoffset;
include/libfdt.h +0 -6
@@ -78,12 +78,6 @@ int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,int fdt_subnode_offset (const void *fdt,int parentoffset,const char *name);int fdt_find_node_by_path (const void *fdt,const char *path); -int fdt_find_node_by_type (const void *fdt,int nodeoffset,const char *type); - -int fdt_node_is_compatible (const void *fdt,int nodeoffset, -const char *compat); -int fdt_find_compatible_node (const void *fdt,int nodeoffset, -const char *type,const char *compat);struct fdt_property *fdt_get_property (const void *fdt,int nodeoffset,const char *name,int *lenp);
libfdt/fdt_ro.c +0 -112
118 lines not on this page · raw message
libfdt/fdt_rw.c +0 -26
@@ -188,32 +188,6 @@ int fdt_setprop(void *fdt, int nodeoffset, const char *name,return 0 ; } -/** -* fdt_find_and_setprop: Find a node and set it's property -* -* @fdt: ptr to device tree -* @node: path of node -* @prop: property name -* @val: ptr to new value -* @len: length of new property value -* @create: flag to create the property if it doesn't exist -* -* Convenience function to directly set a property given the path to the node. -*/ -int fdt_find_and_setprop (void *fdt,const char *node,const char *prop, -const void *val,int len,int create) -{ -int nodeoff =fdt_find_node_by_path (fdt, node); - -if (nodeoff <0 ) -return nodeoff; - -if ((!create) && (fdt_get_property (fdt, nodeoff, prop,0 ) ==NULL )) -return 0 ;/* create flag not set; so exit quietly */ - -return fdt_setprop (fdt, nodeoff, prop, val, len); -} -int fdt_delprop (void *fdt,int nodeoffset,const char *name) {struct fdt_property *prop;
Signature · 1 line
1.5.2.4
RFC PATCH 1/2 Removed some nonused fdt functions and moved fdt_find_and_setprop out of libfdt
Quoted 6 lines · Kumar Gala
Removed:
fdt_node_is_compatible
fdt_find_node_by_type
fdt_find_compatible_nodeTo ease merge of newer libfdt as we aren't using them anywhere at this time.
I use them for development (new projects). When can we expect the new libfdt to be available in U-Boot?
Wolfgang.
RFC PATCH 1/2 Removed some nonused fdt functions and moved fdt_find_and_setprop out of libfdt
Quoted 6 lines · Wolfgang Grandegger
Quoted 5 lines · Kumar Gala
Removed:
fdt_node_is_compatible
fdt_find_node_by_type
fdt_find_compatible_node
Quoted 6 lines
Quoted 1 line
To ease merge of newer libfdt as we aren't using them anywhere at this time.
I use them for development (new projects). When can we expect the new libfdt to be available in U-Boot?
Wolfgang.
Hi Kumar, Wolfgang,
My current thought is that we need a place above libfdt where we can put our convenience (and difference-of-opinion ;-) utility routines.
I'm thinking
common/fdt_support.c
would be the place for this. Then Wolfgang G can put his fdt_* kernel-parallel routines (above) in there as well as the utility routine that Grant created (find & set, I forgot the exact name).
gvb
RFC PATCH 1/2 Removed some nonused fdt functions and moved fdt_find_and_setprop out of libfdt
Quoted 19 lines · Jerry Van Baren
Quoted 11 lines · Wolfgang Grandegger
Quoted 7 lines · Kumar Gala
Removed:
fdt_node_is_compatible
fdt_find_node_by_type
fdt_find_compatible_nodeTo ease merge of newer libfdt as we aren't using them anywhere at this time.
I use them for development (new projects). When can we expect the new libfdt to be available in U-Boot?
Wolfgang.Hi Kumar, Wolfgang,
My current thought is that we need a place above libfdt where we can put our convenience (and difference-of-opinion ;-) utility routines.
Quoted 5 lines
I'm thinking
common/fdt_support.c
would be the place for this. Then Wolfgang G can put his fdt_* kernel-parallel routines (above) in there as well as the utility routine that Grant created (find & set, I forgot the exact name).
Agreed, I moved Grant's fdt_find_and_setprop into common/fdt_support.c
Also, realize there are equivalent functions tofdt_node_is_compatible, etc. in the new libfdt.
- k
RFC PATCH 1/2 Removed some nonused fdt functions and moved fdt_find_and_setprop out of libfdt
Quoted 26 lines · Kumar Gala
Quoted 18 lines · Jerry Van Baren
Quoted 11 lines · Wolfgang Grandegger
Quoted 7 lines · Kumar Gala
Removed:
fdt_node_is_compatible
fdt_find_node_by_type
fdt_find_compatible_nodeTo ease merge of newer libfdt as we aren't using them anywhere at this time.
I use them for development (new projects). When can we expect the new libfdt to be available in U-Boot?
Wolfgang.Hi Kumar, Wolfgang,
My current thought is that we need a place above libfdt where we can put our convenience (and difference-of-opinion ;-) utility routines.
Quoted 5 lines
I'm thinking
common/fdt_support.c
would be the place for this. Then Wolfgang G can put his fdt_* kernel-parallel routines (above) in there as well as the utility routine that Grant created (find & set, I forgot the exact name).
Quoted 6 lines
Agreed, I moved Grant's
fdt_find_and_setpropintocommon/fdt_support.cAlso, realize there are equivalent functions to
fdt_node_is_compatible, etc. in the new libfdt.- k
Ahh, right, the brain was shorted, too much caffeine, too little caffeine, its hard to get it balanced.
My re-reading reminded me - question for Wolfgang Denk - are Doxygen tags in the source code acceptable?
Best regards,
gvb
RFC PATCH 1/2 Removed some nonused fdt functions and moved fdt_find_and_setprop out of libfdt
In reply to Kumar GalaQuoted 27 lines · Kumar Gala
Quoted 15 lines · Jerry Van Baren
Quoted 11 lines · Wolfgang Grandegger
Quoted 7 lines · Kumar Gala
Removed:
fdt_node_is_compatible
fdt_find_node_by_type
fdt_find_compatible_nodeTo ease merge of newer libfdt as we aren't using them anywhere at this time.
I use them for development (new projects). When can we expect the new libfdt to be available in U-Boot?
Wolfgang.Hi Kumar, Wolfgang,
Quoted 8 lines
My current thought is that we need a place above libfdt where we can put our convenience (and difference-of-opinion ;-) utility routines.
I'm thinking
common/fdt_support.c
would be the place for this. Then Wolfgang G can put his fdt_* kernel-parallel routines (above) in there as well as the utility routine that Grant created (find & set, I forgot the exact name).
Quoted 4 lines
Agreed, I moved Grant's
fdt_find_and_setpropintocommon/fdt_support.cAlso, realize there are equivalent functions to
fdt_node_is_compatible, etc. in the new libfdt.
Yes, my concern was about removing the functionality for a while but you imported the new libfdt in the same patch series. Sorry for the noise.
Wolfgang.