|
@@ -331,6 +331,29 @@ struct pci_dn *pci_add_device_node_info(struct pci_controller *hose,
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(pci_add_device_node_info);
|
|
|
|
|
|
+void pci_remove_device_node_info(struct device_node *dn)
|
|
|
+{
|
|
|
+ struct pci_dn *pdn = dn ? PCI_DN(dn) : NULL;
|
|
|
+#ifdef CONFIG_EEH
|
|
|
+ struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
|
|
|
+
|
|
|
+ if (edev)
|
|
|
+ edev->pdn = NULL;
|
|
|
+#endif
|
|
|
+
|
|
|
+ if (!pdn)
|
|
|
+ return;
|
|
|
+
|
|
|
+ WARN_ON(!list_empty(&pdn->child_list));
|
|
|
+ list_del(&pdn->list);
|
|
|
+ if (pdn->parent)
|
|
|
+ of_node_put(pdn->parent->node);
|
|
|
+
|
|
|
+ dn->data = NULL;
|
|
|
+ kfree(pdn);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(pci_remove_device_node_info);
|
|
|
+
|
|
|
/*
|
|
|
* Traverse a device tree stopping each PCI device in the tree.
|
|
|
* This is done depth first. As each node is processed, a "pre"
|