* [PATCH] software node: fix node group deregistration kernel-doc
@ 2026-11-16 10:38 Johan Hovold
2026-11-20 13:18 ` Rafael J. Wysocki (Intel)
0 siblings, 1 reply; 3+ messages in thread
From: Johan Hovold @ 2026-11-16 10:38 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Johan Hovold
Cc: Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
Bartosz Golaszewski, linux-acpi, driver-core, linux-kernel
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@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] software node: fix node group deregistration kernel-doc
2026-11-16 10:38 [PATCH] software node: fix node group deregistration kernel-doc Johan Hovold
@ 2026-11-20 13:18 ` Rafael J. Wysocki (Intel)
2026-11-20 13:39 ` Johan Hovold
0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki (Intel) @ 2026-11-20 13:18 UTC (permalink / raw)
To: Johan Hovold
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
Bartosz Golaszewski, linux-acpi, driver-core, linux-kernel
On Mon, Nov 16, 2026 at 11:38 AM Johan Hovold <johan@kernel.org> 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@gmail.com>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>
LGTM
Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
> ---
> 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
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] software node: fix node group deregistration kernel-doc
2026-11-20 13:18 ` Rafael J. Wysocki (Intel)
@ 2026-11-20 13:39 ` Johan Hovold
0 siblings, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2026-11-20 13:39 UTC (permalink / raw)
To: Rafael J. Wysocki (Intel)
Cc: Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
Daniel Scally, Heikki Krogerus, Sakari Ailus,
Bartosz Golaszewski, linux-acpi, driver-core, linux-kernel
On Fri, Nov 20, 2026 at 02:18:24PM +0100, Rafael J. Wysocki wrote:
> On Mon, Nov 16, 2026 at 11:38 AM Johan Hovold <johan@kernel.org> 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@gmail.com>
> > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Signed-off-by: Johan Hovold <johan@kernel.org>
>
> LGTM
>
> Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
Applied for -next.
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-20 13:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 10:38 [PATCH] software node: fix node group deregistration kernel-doc Johan Hovold
2026-11-20 13:18 ` Rafael J. Wysocki (Intel)
2026-11-20 13:39 ` Johan Hovold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®