Re: [PATCH v3 7/8] software node: fix software_node_notify() primary node comment
From: Rafael J. Wysocki (Intel)
Date: Tue Nov 17 2026 - 10:26:03 EST
On Tue, Nov 17, 2026 at 11:13 AM Johan Hovold <johan@xxxxxxxxxx> wrote:
>
> The firmware node pointer in struct device may point to either a primary
> or a secondary firmware node and driver core sets the dev pointer of
> that node when registering devices.
>
> Fix the comments in software_node_notify() and
> software_node_notify_remove() which incorrectly suggest that driver
> core only sets the dev pointer of primary firmware nodes.
>
> Fixes: 37e586675993 ("software node: add fw_devlink support")
> Cc: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
> Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
LGTM
Acked-by: Rafael J. Wysocki (Intel) <rafael@xxxxxxxxxx>
> ---
> drivers/base/swnode.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
> index 95283d8bda26..78e224539b02 100644
> --- a/drivers/base/swnode.c
> +++ b/drivers/base/swnode.c
> @@ -1162,8 +1162,8 @@ void software_node_notify(struct device *dev)
> return;
>
> /*
> - * When the software node is the device's secondary firmware node,
> - * the core only records the owning device on the primary fwnode
> + * When a device has both a primary and a secondary firmware node the
> + * core only records the owning device in the primary node
> * (see device_add()). fw_devlink resolves a supplier device through
> * fwnode->dev, so without this a consumer referencing the software
> * node could never find the supplier device and would defer forever.
> @@ -1198,9 +1198,8 @@ void software_node_notify_remove(struct device *dev)
> sysfs_remove_link(&dev->kobj, "software_node");
>
> /*
> - * Drop the device pointer mirrored onto a secondary software node in
> - * software_node_notify(). For a primary software node the core owns
> - * fwnode->dev and clears it in device_del().
> + * Clear any device pointer set in a secondary software node in
> + * software_node_notify().
> */
> if (!device_match_fwnode(dev, &swnode->fwnode) && swnode->fwnode.dev == dev)
> swnode->fwnode.dev = NULL;
> --
> 2.56.1
>
>