Re: [PATCH v3 3/8] software node: fix device_add_software_node() kernel doc
From: Rafael J. Wysocki (Intel)
Date: Tue Nov 17 2026 - 10:06:41 EST
On Tue, Nov 17, 2026 at 11:13 AM Johan Hovold <johan@xxxxxxxxxx> wrote:
>
> Software nodes added to a device by device_add_software_node() are
> always secondary firmware nodes even if they may be stored in the
> dev->fwnode pointer.
>
> Fix the kernel doc which incorrectly claims that a software node added
> using this interface "could become the primary node".
>
> Also clarify that device_remove_software_node() should only be used to
> remove software nodes added by device_add_software_node().
>
> Fixes: e68d0119e328 ("software node: Introduce device_add_software_node()")
> Cc: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
> Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
LGTM
Acked-by: Rafael J. Wysocki (Intel) <rafael@xxxxxxxxxx>
> ---
> drivers/base/swnode.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
> index ce4efc506b9c..b2593b2fcada 100644
> --- a/drivers/base/swnode.c
> +++ b/drivers/base/swnode.c
> @@ -1048,9 +1048,8 @@ EXPORT_SYMBOL_GPL(fwnode_remove_software_node);
> * @dev: The device the software node is meant for.
> * @node: The software node.
> *
> - * This function will make @node the secondary firmware node pointer of @dev. If
> - * @dev has no primary node, then @node will become the primary node. The
> - * function will register @node automatically if it wasn't already registered.
> + * Register @node if it was not already registered and make it the secondary
> + * firmware node of @dev.
> */
> int device_add_software_node(struct device *dev, const struct software_node *node)
> {
> @@ -1091,7 +1090,8 @@ EXPORT_SYMBOL_GPL(device_add_software_node);
> * device_remove_software_node - Remove device's software node
> * @dev: The device with the software node.
> *
> - * This function will unregister the software node of @dev.
> + * Remove a software node added by device_add_software_node() and
> + * deregister it if this is the last reference.
> */
> void device_remove_software_node(struct device *dev)
> {
> --
> 2.56.1
>
>