diff options
author | Thierry Reding <treding@nvidia.com> | 2016-11-25 05:57:10 -0500 |
---|---|---|
committer | Bjorn Helgaas <helgaas@kernel.org> | 2016-12-07 13:05:48 -0500 |
commit | 5909406598d9fab58be860b72dff9409bff11653 (patch) | |
tree | ac32f861756ae7f87003e25b70f64932ba6665fc /drivers/pci | |
parent | 37d6a0a6f4700ad3ae7bbf8db38b4557e97b3fe4 (diff) |
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 'drivers/pci')
-rw-r--r-- | drivers/pci/probe.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 4853c8fbd701..cf9cb6f30782 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -521,11 +521,11 @@ static void pci_release_host_bridge_dev(struct device *dev) | |||
521 | kfree(bridge); | 521 | kfree(bridge); |
522 | } | 522 | } |
523 | 523 | ||
524 | static struct pci_host_bridge *pci_alloc_host_bridge(void) | 524 | static struct pci_host_bridge *pci_alloc_host_bridge(size_t priv) |
525 | { | 525 | { |
526 | struct pci_host_bridge *bridge; | 526 | struct pci_host_bridge *bridge; |
527 | 527 | ||
528 | bridge = kzalloc(sizeof(*bridge), GFP_KERNEL); | 528 | bridge = kzalloc(sizeof(*bridge) + priv, GFP_KERNEL); |
529 | if (!bridge) | 529 | if (!bridge) |
530 | return NULL; | 530 | return NULL; |
531 | 531 | ||
@@ -2253,7 +2253,7 @@ static struct pci_bus *pci_create_root_bus_msi(struct device *parent, | |||
2253 | int error; | 2253 | int error; |
2254 | struct pci_host_bridge *bridge; | 2254 | struct pci_host_bridge *bridge; |
2255 | 2255 | ||
2256 | bridge = pci_alloc_host_bridge(); | 2256 | bridge = pci_alloc_host_bridge(0); |
2257 | if (!bridge) | 2257 | if (!bridge) |
2258 | return NULL; | 2258 | return NULL; |
2259 | 2259 | ||