Re: [PATCH v3 02/10] software node: increase the reference of the swnode by its fwnode

Bartosz Golaszewski
2025-10-31T09:04:00Z

On Fri, Oct 31, 2025 at 9:30 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Thu, Oct 30, 2025 at 03:33:02AM -0700, Bartosz Golaszewski wrote:
> > On Thu, 30 Oct 2025 10:34:46 +0100, Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> said:
> > > On Wed, Oct 29, 2025 at 01:28:36PM +0100, Bartosz Golaszewski wrote:
> > >>
> > >> Once we allow software nodes to reference other kinds of firmware nodes,
> > >> the node in args will no longer necessarily be a software node so bump
> > >> its reference count using its fwnode interface.
> > >
> > > Same, a short comment (or an update of a kernel-doc if present, I don't
> > > remember).
> > >
> >
> > Andy: the resulting code after patch 3/10 looks like this:
> >
> > struct fwnode_handle *refnode;
> >
> > (...)
>
> Let's say something like below to be put here
>
> /*
> * The reference in software node may refer to a node of a different type.
> * Depending on the type we choose either to use software node directly, or
> * delegate that to fwnode API.
> */
>

But this is incorrect: we're not really doing that. We either use the
firmware node reference directly OR cast the software node to its
firmware node representation. We ALWAYS use the firmware node API
below.

This really *is* evident from the code but if it'll make you happy and
make you sign off on this, I'll add a corrected version.

IMO It's completely redundant.

Bartosz