Commit 0cb71708 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull PCI fix from Bjorn Helgaas:

 - When removing a PCI device, only look up and remove a platform device
   if there is an associated device node for which there could be a
   platform device, to fix a merge window regression (Brian Norris)

* tag 'pci-v6.13-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci:
  PCI/pwrctrl: Unregister platform device only if one actually exists
parents 8a6a03ad 5c8418cf
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -19,14 +19,19 @@ static void pci_free_resources(struct pci_dev *dev)

static void pci_pwrctrl_unregister(struct device *dev)
{
	struct device_node *np;
	struct platform_device *pdev;

	pdev = of_find_device_by_node(dev_of_node(dev));
	np = dev_of_node(dev);
	if (!np)
		return;

	pdev = of_find_device_by_node(np);
	if (!pdev)
		return;

	of_device_unregister(pdev);
	of_node_clear_flag(dev_of_node(dev), OF_POPULATED);
	of_node_clear_flag(np, OF_POPULATED);
}

static void pci_stop_dev(struct pci_dev *dev)