aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/of_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/of/of_pci.c')
-rw-r--r--drivers/of/of_pci.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/drivers/of/of_pci.c b/drivers/of/of_pci.c
index 0ee42c3e66a1..c9d4d3a7b0fe 100644
--- a/drivers/of/of_pci.c
+++ b/drivers/of/of_pci.c
@@ -285,51 +285,6 @@ parse_failed:
285EXPORT_SYMBOL_GPL(of_pci_get_host_bridge_resources); 285EXPORT_SYMBOL_GPL(of_pci_get_host_bridge_resources);
286#endif /* CONFIG_OF_ADDRESS */ 286#endif /* CONFIG_OF_ADDRESS */
287 287
288#ifdef CONFIG_PCI_MSI
289
290static LIST_HEAD(of_pci_msi_chip_list);
291static DEFINE_MUTEX(of_pci_msi_chip_mutex);
292
293int of_pci_msi_chip_add(struct msi_controller *chip)
294{
295 if (!of_property_read_bool(chip->of_node, "msi-controller"))
296 return -EINVAL;
297
298 mutex_lock(&of_pci_msi_chip_mutex);
299 list_add(&chip->list, &of_pci_msi_chip_list);
300 mutex_unlock(&of_pci_msi_chip_mutex);
301
302 return 0;
303}
304EXPORT_SYMBOL_GPL(of_pci_msi_chip_add);
305
306void of_pci_msi_chip_remove(struct msi_controller *chip)
307{
308 mutex_lock(&of_pci_msi_chip_mutex);
309 list_del(&chip->list);
310 mutex_unlock(&of_pci_msi_chip_mutex);
311}
312EXPORT_SYMBOL_GPL(of_pci_msi_chip_remove);
313
314struct msi_controller *of_pci_find_msi_chip_by_node(struct device_node *of_node)
315{
316 struct msi_controller *c;
317
318 mutex_lock(&of_pci_msi_chip_mutex);
319 list_for_each_entry(c, &of_pci_msi_chip_list, list) {
320 if (c->of_node == of_node) {
321 mutex_unlock(&of_pci_msi_chip_mutex);
322 return c;
323 }
324 }
325 mutex_unlock(&of_pci_msi_chip_mutex);
326
327 return NULL;
328}
329EXPORT_SYMBOL_GPL(of_pci_find_msi_chip_by_node);
330
331#endif /* CONFIG_PCI_MSI */
332
333/** 288/**
334 * of_pci_map_rid - Translate a requester ID through a downstream mapping. 289 * of_pci_map_rid - Translate a requester ID through a downstream mapping.
335 * @np: root complex device node. 290 * @np: root complex device node.