Re: [PATCH] phy: ti: omap-usb2: fix OF node leak at probe
From: Markus Elfring
Date: Wed Nov 18 2026 - 14:20:35 EST
…
> Drop the node reference right after of_find_device_by_node(); the
> device reference taken by of_find_device_by_node() keeps the platform
> device alive and is released at unbind by the devm action registered
> below.
How do you think about to reduce also the scope for the corresponding local
variable “control_node”?
https://elixir.bootlin.com/linux/v7.4-rc1/source/drivers/phy/ti/phy-omap-usb2.c#L373-L515
Would you eventually like to increase the application of scope-based resource management?
https://elixir.bootlin.com/linux/v7.4-rc1/source/include/linux/of.h#L138
Regards,
Markus