Re: [PATCH v7 5/6] spi: cs42l43: Add SPI controller support

From: Andy Shevchenko
Date: Fri Jan 19 2024 - 11:10:14 EST


On Fri, Jan 19, 2024 at 1:49 PM Charles Keepax
<ckeepax@xxxxxxxxxxxxxxxxxxxxx> wrote:
> On Thu, Jan 18, 2024 at 07:06:13PM +0200, andy.shevchenko@xxxxxxxxx wrote:

..

> > > + if (is_of_node(fwnode))
> > > + fwnode = fwnode_get_named_child_node(fwnode, "spi");
> >
> > You can actually drop these is_of_node() tests and use another variable In
> > ACPI there can't be child node in small letters.
>
> is_of_node feels pretty clear what the intent is, rather than
> relying on nodes not existing etc.
>
> > But main problem here (and in another driver where the similar is used) that
> > you bumped reference count for fwnode. I haven't seen where you drop it back.
> > Have you tested rmmod/modprobe in a loop?
>
> Yeah it should drop the reference will add that.

Note, this will require an additional variable anyway (as in the
infamous `x = realloc(x...)` mistake).

--
With Best Regards,
Andy Shevchenko