Re: [PATCH] software node: fix node group deregistration kernel-doc

From: Rafael J. Wysocki (Intel)

Date: Fri Nov 20 2026 - 08:18:44 EST


On Mon, Nov 16, 2026 at 11:38 AM Johan Hovold <johan@xxxxxxxxxx> wrote:
>
> Child software nodes hold a reference to their parent via kobj->parent
> so there was never any need to deregister them in any particular order.
>
> Drop the misleading kernel-doc comments which suggest that deregistering
> a parent node before a child could cause trouble.
>
> Note that parent nodes still need to be registered before their children
> or registration will fail.
>
> Fixes: fc002f0f23e2 ("media: software_node: unregister software_nodes in reverse order")
> Fixes: 0b8bf06f6719 ("device property: Sync descriptions of swnode array and group APIs")
> Cc: Daniel Scally <djrscally@xxxxxxxxx>
> Cc: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>

LGTM

Acked-by: Rafael J. Wysocki (Intel) <rafael@xxxxxxxxxx>

> ---
> drivers/base/swnode.c | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
> index 8e12f518e13f..78e224539b02 100644
> --- a/drivers/base/swnode.c
> +++ b/drivers/base/swnode.c
> @@ -954,14 +954,7 @@ 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. 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).
> + * Unregister multiple software nodes at once.
> */
> void software_node_unregister_node_group(const struct software_node * const *node_group)
> {
> --
> 2.56.1
>