19 Jan
2024
19 Jan
'24
5:09 p.m.
On Fri, Jan 19, 2024 at 1:49 PM Charles Keepax ckeepax@opensource.cirrus.com wrote:
On Thu, Jan 18, 2024 at 07:06:13PM +0200, andy.shevchenko@gmail.com 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