On Tue, Jul 22, 2025 at 11:08:33AM +0100, Jonathan Cameron wrote:
On Mon, 21 Jul 2025 17:36:08 +0200 Johan Hovold johan+linaro@kernel.org wrote:
@@ -2515,9 +2515,15 @@ static struct platform_device *pci_pwrctrl_create_device(struct pci_bus *bus, in struct device_node *np; np = of_pci_find_child_device(dev_of_node(&bus->dev), devfn);
- if (!np || of_find_device_by_node(np))
- if (!np) return NULL;
- pdev = of_find_device_by_node(np);
Given we have two entirely different pdevs in here, I'd use an extra local variable to indicate what this one is the pwctrl one created below.
It's actually the same pwrctrl platform device (which may have been created in an earlier call to the function) so using the same variable should be fine.
Johan