[PATCH v2 3/8] swnode: fix device_add_of_node() kernel doc

From: Johan Hovold

Date: Tue Nov 10 2026 - 04:25:04 EST


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>
---
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 65e9388af865..5dc2029f9a7b 100644
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -1055,9 +1055,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)
{
@@ -1098,7 +1097,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.0