mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
PCI: Add helper functions pci_get[put]_host_bridge_device()
Add helper functions to get/put the root bus's host bridge device. Tested-by: Suravee Suthikulpanit <[email protected]> (AMD Seattle) Signed-off-by: Murali Karicheri <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Acked-by: Will Deacon <[email protected]> CC: Joerg Roedel <[email protected]> CC: Grant Likely <[email protected]> CC: Rob Herring <[email protected]> CC: Russell King <[email protected]> CC: Arnd Bergmann <[email protected]>
This commit is contained in:
parent
0c79c81c77
commit
6675a601d7
2 changed files with 17 additions and 0 deletions
|
|
@ -23,6 +23,20 @@ static struct pci_host_bridge *find_pci_host_bridge(struct pci_bus *bus)
|
|||
return to_pci_host_bridge(root_bus->bridge);
|
||||
}
|
||||
|
||||
struct device *pci_get_host_bridge_device(struct pci_dev *dev)
|
||||
{
|
||||
struct pci_bus *root_bus = find_pci_root_bus(dev->bus);
|
||||
struct device *bridge = root_bus->bridge;
|
||||
|
||||
kobject_get(&bridge->kobj);
|
||||
return bridge;
|
||||
}
|
||||
|
||||
void pci_put_host_bridge_device(struct device *dev)
|
||||
{
|
||||
kobject_put(&dev->kobj);
|
||||
}
|
||||
|
||||
void pci_set_host_bridge_release(struct pci_host_bridge *bridge,
|
||||
void (*release_fn)(struct pci_host_bridge *),
|
||||
void *release_data)
|
||||
|
|
|
|||
Loading…
Reference in a new issue