diff mbox series

[v2] drivers/of: Improve documentation for match_string

Message ID 20240911204938.9172-1-mikisabate@gmail.com
State Accepted
Headers show
Series [v2] drivers/of: Improve documentation for match_string | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied fail build log

Commit Message

Miquel Sabaté Solà Sept. 11, 2024, 8:49 p.m. UTC
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>
---
 drivers/of/property.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

--
2.46.0

Comments

Rob Herring Sept. 12, 2024, 8:32 p.m. UTC | #1
On Wed, 11 Sep 2024 22:49:38 +0200, Miquel Sabaté Solà wrote:
> 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>
> ---
>  drivers/of/property.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 

Applied, thanks!
Miquel Sabaté Solà Sept. 12, 2024, 8:56 p.m. UTC | #2
On dj., de set. 12 2024, Rob Herring (Arm) wrote:

> On Wed, 11 Sep 2024 22:49:38 +0200, Miquel Sabaté Solà wrote:
>> 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>
>> ---
>>  drivers/of/property.c | 13 +++++++++----
>>  1 file changed, 9 insertions(+), 4 deletions(-)
>> 
>
> Applied, thanks!

Great, thanks!
diff mbox series

Patch

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 164d77cb9445..d66ea8a83562 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)