diff options
author | Frank Rowand <frowand.list@gmail.com> | 2023-02-13 21:57:02 +0300 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2023-02-21 00:37:19 +0300 |
commit | d9194e009efef9613f48022f3c885191c48120f9 (patch) | |
tree | 12609eee961b9c7845c0d8173271db84422f4829 /drivers/of/dynamic.c | |
parent | ec0b7e24d566a843e3cfba21a6471170fdb0f810 (diff) | |
download | linux-d9194e009efef9613f48022f3c885191c48120f9.tar.xz |
of: dynamic: add lifecycle docbook info to node creation functions
The existing docbook comments for the functions related to creating
a devicetree node do not explain the reference count of a newly
created node, how decrementing the reference count to zero will
free the associated memory, and the caller's responsibility to
call of_node_put() on the node. Explain what happens when the
reference count is decremented to zero.
Signed-off-by: Frank Rowand <frowand.list@gmail.com>
Link: https://lore.kernel.org/r/20230213185702.395776-8-frowand.list@gmail.com
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/dynamic.c')
-rw-r--r-- | drivers/of/dynamic.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index 657a65006056..12aa99018969 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -443,7 +443,8 @@ struct property *__of_prop_dup(const struct property *prop, gfp_t allocflags) * another node. The node data are dynamically allocated and all the node * flags have the OF_DYNAMIC & OF_DETACHED bits set. * - * Return: The newly allocated node or NULL on out of memory error. + * Return: The newly allocated node or NULL on out of memory error. Use + * of_node_put() on it when done to free the memory allocated for it. */ struct device_node *__of_node_dup(const struct device_node *np, const char *full_name) |