Skip to content
Snippets Groups Projects
Commit 0cb71708 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents 8a6a03ad 5c8418cf
No related branches found
No related tags found
No related merge requests found
...@@ -19,14 +19,19 @@ static void pci_free_resources(struct pci_dev *dev) ...@@ -19,14 +19,19 @@ static void pci_free_resources(struct pci_dev *dev)
static void pci_pwrctrl_unregister(struct device *dev) static void pci_pwrctrl_unregister(struct device *dev)
{ {
struct device_node *np;
struct platform_device *pdev; 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) if (!pdev)
return; return;
of_device_unregister(pdev); 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) static void pci_stop_dev(struct pci_dev *dev)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment