summaryrefslogtreecommitdiffstats
path: root/drivers/base/swnode.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-03-08 12:36:44 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-23 15:04:01 +0100
commit0b8bf06f67191e6a3184802a690d3f521c6d7e78 (patch)
tree68aec2379a314fecbed5f1543cff677ecf8b9ba5 /drivers/base/swnode.c
parent6579c8d97ad7fc5671ee60234f3b8388abee5f77 (diff)
downloadlinux-0b8bf06f67191e6a3184802a690d3f521c6d7e78.tar.bz2
device property: Sync descriptions of swnode array and group APIs
After a few updates against swnode APIs the kernel documentation, i.e. for swnode group registration and unregistration deviates from the one for swnode array. In general, the same rules are applied to both. Hence, synchronize descriptions of swnode array and group APIs Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210308103644.81960-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/swnode.c')
-rw-r--r--drivers/base/swnode.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
index fa3719ef80e4..579ef8e24db0 100644
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -880,7 +880,11 @@ EXPORT_SYMBOL_GPL(software_node_unregister_nodes);
* software_node_register_node_group - Register a group of software nodes
* @node_group: NULL terminated array of software node pointers to be registered
*
- * Register multiple software nodes at once.
+ * Register multiple software nodes at once. If any node in the array
+ * has its .parent pointer set (which can only be to another software_node),
+ * then its parent **must** have been registered before it is; either outside
+ * of this function or by ordering the array such that parent comes before
+ * child.
*/
int software_node_register_node_group(const struct software_node **node_group)
{
@@ -906,10 +910,14 @@ EXPORT_SYMBOL_GPL(software_node_register_node_group);
* software_node_unregister_node_group - Unregister a group of software nodes
* @node_group: NULL terminated array of software node pointers to be unregistered
*
- * Unregister multiple software nodes at once. The array will be unwound in
- * reverse order (i.e. last entry first) and thus if any members of the array are
- * children of another member then the children must appear later in the list such
- * that they are unregistered first.
+ * Unregister multiple software nodes at once. If parent pointers are set up
+ * in any of the software nodes then the array **must** be ordered such that
+ * parents come before their children.
+ *
+ * NOTE: If you are uncertain whether the array is ordered such that
+ * parents will be unregistered before their children, it is wiser to
+ * remove the nodes individually, in the correct order (child before
+ * parent).
*/
void software_node_unregister_node_group(
const struct software_node **node_group)