Skip to content

Commit 6417edb

Browse files
mssolarobherring
authored andcommitted
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à <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring (Arm) <[email protected]>
1 parent 69b8600 commit 6417edb

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

drivers/of/property.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,12 +452,17 @@ EXPORT_SYMBOL_GPL(of_property_read_string);
452452

453453
/**
454454
* of_property_match_string() - Find string in a list and return index
455-
* @np: pointer to node containing string list property
455+
* @np: pointer to the node containing the string list property
456456
* @propname: string list property name
457-
* @string: pointer to string to search for in string list
457+
* @string: pointer to the string to search for in the string list
458458
*
459-
* This function searches a string list property and returns the index
460-
* of a specific string value.
459+
* Search for an exact match of string in a device node property which is a
460+
* string of lists.
461+
*
462+
* Return: the index of the first occurrence of the string on success, -EINVAL
463+
* if the property does not exist, -ENODATA if the property does not have a
464+
* value, and -EILSEQ if the string is not null-terminated within the length of
465+
* the property data.
461466
*/
462467
int of_property_match_string(const struct device_node *np, const char *propname,
463468
const char *string)

0 commit comments

Comments
 (0)