cregit-Linux how code gets into the kernel

Release 4.11 drivers/pci/of.c

Directory: drivers/pci
/*
 * PCI <-> OF mapping helpers
 *
 * Copyright 2011 IBM Corp.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */

#include <linux/irqdomain.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/of_pci.h>
#include "pci.h"


void pci_set_of_node(struct pci_dev *dev) { if (!dev->bus->dev.of_node) return; dev->dev.of_node = of_pci_find_child_device(dev->bus->dev.of_node, dev->devfn); }

Contributors

PersonTokensPropCommitsCommitProp
Benjamin Herrenschmidt43100.00%1100.00%
Total43100.00%1100.00%


void pci_release_of_node(struct pci_dev *dev) { of_node_put(dev->dev.of_node); dev->dev.of_node = NULL; }

Contributors

PersonTokensPropCommitsCommitProp
Benjamin Herrenschmidt27100.00%1100.00%
Total27100.00%1100.00%


void pci_set_bus_of_node(struct pci_bus *bus) { if (bus->self == NULL) bus->dev.of_node = pcibios_get_phb_of_node(bus); else bus->dev.of_node = of_node_get(bus->self->dev.of_node); }

Contributors

PersonTokensPropCommitsCommitProp
Benjamin Herrenschmidt47100.00%1100.00%
Total47100.00%1100.00%


void pci_release_bus_of_node(struct pci_bus *bus) { of_node_put(bus->dev.of_node); bus->dev.of_node = NULL; }

Contributors

PersonTokensPropCommitsCommitProp
Benjamin Herrenschmidt27100.00%1100.00%
Total27100.00%1100.00%


struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus) { /* This should only be called for PHBs */ if (WARN_ON(bus->self || bus->parent)) return NULL; /* Look for a node pointer in either the intermediary device we * create above the root bus or it's own parent. Normally only * the later is populated. */ if (bus->bridge->of_node) return of_node_get(bus->bridge->of_node); if (bus->bridge->parent && bus->bridge->parent->of_node) return of_node_get(bus->bridge->parent->of_node); return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
Benjamin Herrenschmidt7492.50%150.00%
David Daney67.50%150.00%
Total80100.00%2100.00%


struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus) { #ifdef CONFIG_IRQ_DOMAIN struct irq_domain *d; if (!bus->dev.of_node) return NULL; /* Start looking for a phandle to an MSI controller. */ d = of_msi_get_domain(&bus->dev, bus->dev.of_node, DOMAIN_BUS_PCI_MSI); if (d) return d; /* * If we don't have an msi-parent property, look for a domain * directly attached to the host bridge. */ d = irq_find_matching_host(bus->dev.of_node, DOMAIN_BUS_PCI_MSI); if (d) return d; return irq_find_host(bus->dev.of_node); #else return NULL; #endif }

Contributors

PersonTokensPropCommitsCommitProp
Marc Zyngier96100.00%3100.00%
Total96100.00%3100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Benjamin Herrenschmidt23468.42%120.00%
Marc Zyngier10229.82%360.00%
David Daney61.75%120.00%
Total342100.00%5100.00%
Directory: drivers/pci
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.