Re: [PATCH 6/6] net: mvpp2: use device_for_each_child_node() to access device child nodes

Russell King (Oracle)
2024-07-29T13:01:33Z

On Mon, Jul 29, 2024 at 11:23:47AM +0200, Javier Carrasco wrote:
> Apart from that, there is a suspicious check towards the end of the same
> function:
>
> if (is_acpi_node(port_fwnode))
> return;
>
> At the point it is called in the current implementation, port_fwnode
> could have been cleaned. And after removing the loop, it is simply
> uninitialized. Was that meant to be pdev->dev->fwnode?

If you're referring to the one before the clk_disable_unprepare() calls,
it's only slightly suspicious:

These clocks are setup in a:

if (dev_of_node(&pdev->dev)) {
...
}

block, so they're only setup if we have device tree. So, avoiding it
for ACPI is entirely reasonable. However, we also have software nodes
as well, so the test should be:

if (!dev_of_node(&pdev->dev))
return;

to match what the probe function is doing.

Thanks.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!