[PATCH v2 12/41] dm: core: Fix up string-function documentation

Simon Glass sjg at chromium.org
Sun Oct 24 01:26:06 CEST 2021


The details for of_property_read_string_helper() and
ofnode_read_string_index() are a little inaccurate. Fix up the comments to
avoid confusion.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 drivers/core/of_access.c | 3 ++-
 include/dm/ofnode.h      | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/core/of_access.c b/drivers/core/of_access.c
index 9960e6b310b..3707143ae66 100644
--- a/drivers/core/of_access.c
+++ b/drivers/core/of_access.c
@@ -581,7 +581,8 @@ int of_property_match_string(const struct device_node *np, const char *propname,
  * @propname:	name of the property to be searched.
  * @out_strs:	output array of string pointers.
  * @sz:		number of array elements to read.
- * @skip:	Number of strings to skip over at beginning of list.
+ * @skip:	Number of strings to skip over at beginning of list (cannot be
+ *	negative)
  *
  * Don't call this function directly. It is a utility helper for the
  * of_property_read_string*() family of functions.
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 6a714d0c7b5..4faa9bfa563 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -590,11 +590,11 @@ int ofnode_stringlist_search(ofnode node, const char *propname,
  *
  * @node: node to check
  * @propname: name of the property containing the string list
- * @index: index of the string to return
+ * @index: index of the string to return (cannot be negative)
  * @lenp: return location for the string length or an error code on failure
  *
  * @return:
- *   length of string, if found or -ve error value if not found
+ *   0 if found or -ve error value if not found
  */
 int ofnode_read_string_index(ofnode node, const char *propname, int index,
 			     const char **outp);
-- 
2.33.0.1079.g6e70778dc9-goog



More information about the U-Boot mailing list