Merge tag 'pci-v6.13-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci

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
This commit is contained in:
Linus Torvalds committed 2024-11-30 18:23:05 -08:00
commit 0cb71708c5
1 file changed
+7 -2
+7 -2
View File
@@ -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)