Skip to content

Commit 0cb7170

Browse files
committed
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
2 parents 8a6a03a + 5c8418c commit 0cb7170

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/pci/remove.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,19 @@ static void pci_free_resources(struct pci_dev *dev)
1919

2020
static void pci_pwrctrl_unregister(struct device *dev)
2121
{
22+
struct device_node *np;
2223
struct platform_device *pdev;
2324

24-
pdev = of_find_device_by_node(dev_of_node(dev));
25+
np = dev_of_node(dev);
26+
if (!np)
27+
return;
28+
29+
pdev = of_find_device_by_node(np);
2530
if (!pdev)
2631
return;
2732

2833
of_device_unregister(pdev);
29-
of_node_clear_flag(dev_of_node(dev), OF_POPULATED);
34+
of_node_clear_flag(np, OF_POPULATED);
3035
}
3136

3237
static void pci_stop_dev(struct pci_dev *dev)

0 commit comments

Comments
 (0)