summaryrefslogtreecommitdiff
path: root/drivers/of
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-09-11 23:49:38 +0300
committerRob Herring (Arm) <robh@kernel.org>2024-09-13 22:01:34 +0300
commit6417edb5d185917c4d7f72b81a4b6ebda26f7856 (patch)
treef7b79bc642baa7e769708dddcc2f5807c326a423 /drivers/of
parent69b860034c33429b5bf7eb89fb8c0ad269ad9cbd (diff)
downloadlinux-6417edb5d185917c4d7f72b81a4b6ebda26f7856.tar.xz
drivers/of: Improve documentation for match_string
The description of the function now explicitly states that it's an *exact* match for the given string (i.e. not a submatch). It also better states all the possible return values. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com> Link: https://lore.kernel.org/r/20240911204938.9172-1-mikisabate@gmail.com Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/property.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/of/property.c b/drivers/of/property.c
index 940324225c34..11b922fde7af 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -452,12 +452,17 @@ EXPORT_SYMBOL_GPL(of_property_read_string);
/**
* of_property_match_string() - Find string in a list and return index
- * @np: pointer to node containing string list property
+ * @np: pointer to the node containing the string list property
* @propname: string list property name
- * @string: pointer to string to search for in string list
+ * @string: pointer to the string to search for in the string list
*
- * This function searches a string list property and returns the index
- * of a specific string value.
+ * Search for an exact match of string in a device node property which is a
+ * string of lists.
+ *
+ * Return: the index of the first occurrence of the string on success, -EINVAL
+ * if the property does not exist, -ENODATA if the property does not have a
+ * value, and -EILSEQ if the string is not null-terminated within the length of
+ * the property data.
*/
int of_property_match_string(const struct device_node *np, const char *propname,
const char *string)