ia64/linux-2.6.18-xen.hg

changeset 814:e3cec0113535

Backport: PCI: allow pci_alloc_child_bus() to handle a NULL bridge

commit 3789fa8a2e534523c896a32a9f27f78d52ad7d82
Author: Yu Zhao <yu.zhao@intel.com>
Date: Sat Nov 22 02:41:07 2008 +0800

PCI: allow pci_alloc_child_bus() to handle a NULL bridge

Allow pci_alloc_child_bus() to allocate buses without bridge
devices.
Some SR-IOV devices can occupy more than one bus number, but there
is no
explicit bridges because that have internal routing mechanism.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Mar 13 07:41:52 2009 +0000 (2009-03-13)
parents 955d92afcbce
children f0dd7eb92bc9
files drivers/pci/probe.c
line diff
     1.1 --- a/drivers/pci/probe.c	Fri Mar 13 07:41:39 2009 +0000
     1.2 +++ b/drivers/pci/probe.c	Fri Mar 13 07:41:52 2009 +0000
     1.3 @@ -392,12 +392,10 @@ pci_alloc_child_bus(struct pci_bus *pare
     1.4  	if (!child)
     1.5  		return NULL;
     1.6  
     1.7 -	child->self = bridge;
     1.8  	child->parent = parent;
     1.9  	child->ops = parent->ops;
    1.10  	child->sysdata = parent->sysdata;
    1.11  	child->bus_flags = parent->bus_flags;
    1.12 -	child->bridge = get_device(&bridge->dev);
    1.13  
    1.14  	child->class_dev.class = &pcibus_class;
    1.15  	sprintf(child->class_dev.class_id, "%04x:%02x", pci_domain_nr(child), busnr);
    1.16 @@ -412,6 +410,12 @@ pci_alloc_child_bus(struct pci_bus *pare
    1.17  	child->primary = parent->secondary;
    1.18  	child->subordinate = 0xff;
    1.19  
    1.20 +	if (!bridge)
    1.21 +		return child;
    1.22 +
    1.23 +	child->self = bridge;
    1.24 +	child->bridge = get_device(&bridge->dev);
    1.25 +
    1.26  	/* Set up default resource pointers and names.. */
    1.27  	for (i = 0; i < 4; i++) {
    1.28  		child->resource[i] = &bridge->resource[PCI_BRIDGE_RESOURCES+i];