summaryrefslogtreecommitdiff
path: root/include/linux/pci.h
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2016-11-25 13:57:10 +0300
committerBjorn Helgaas <helgaas@kernel.org>2016-12-07 21:05:48 +0300
commit5909406598d9fab58be860b72dff9409bff11653 (patch)
treeac32f861756ae7f87003e25b70f64932ba6665fc /include/linux/pci.h
parent37d6a0a6f4700ad3ae7bbf8db38b4557e97b3fe4 (diff)
downloadlinux-5909406598d9fab58be860b72dff9409bff11653.tar.xz
PCI: Allow driver-specific data in host bridge
Provide a way to allocate driver-specific data along with a PCI host bridge structure. The bridge's ->private field points to this data. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r--include/linux/pci.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index f79634612fbf..beacb17e81fb 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -434,10 +434,21 @@ struct pci_host_bridge {
resource_size_t start,
resource_size_t size,
resource_size_t align);
+ unsigned long private[0] ____cacheline_aligned;
};
#define to_pci_host_bridge(n) container_of(n, struct pci_host_bridge, dev)
+static inline void *pci_host_bridge_priv(struct pci_host_bridge *bridge)
+{
+ return (void *)bridge->private;
+}
+
+static inline struct pci_host_bridge *pci_host_bridge_from_priv(void *priv)
+{
+ return container_of(priv, struct pci_host_bridge, private);
+}
+
struct pci_host_bridge *pci_find_host_bridge(struct pci_bus *bus);
void pci_set_host_bridge_release(struct pci_host_bridge *bridge,