Re: [PATCH v2 3/8] swnode: fix device_add_of_node() kernel doc
From: Johan Hovold
Date: Mon Nov 16 2026 - 08:58:20 EST
On Tue, Nov 10, 2026 at 01:00:03PM +0200, Andy Shevchenko wrote:
> On Tue, Nov 10, 2026 at 09:51:19AM +0100, Johan Hovold 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().
>
> ...
>
> > * @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.
>
> While at it, please add a missing Return section (as kernel-doc complains about).
None of the swnode kernel-doc comments have a Return section so that is
better done separately for the whole file.
> > */
> > int device_add_software_node(struct device *dev, const struct software_node *node)
> > {
Johan