]> Pileus Git - ~andy/linux/commit
PCI: Put pci_dev in device tree as early as possible
authorYinghai Lu <yinghai@kernel.org>
Mon, 21 Jan 2013 21:20:52 +0000 (13:20 -0800)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 25 Jan 2013 23:22:37 +0000 (16:22 -0700)
commit4f535093cf8f6da8cfda7c36c2c1ecd2e9586ee4
tree62bf63646dc1c6870c5520b15d0f17aa09e05db5
parent58d9a38f6facb28e935ec2747f6d9e9bf4684118
PCI: Put pci_dev in device tree as early as possible

We want to put pci_dev structs in the device tree as soon as possible so
for_each_pci_dev() iteration will not miss them, but driver attachment
needs to be delayed until after pci_assign_unassigned_resources() to make
sure all devices have resources assigned first.

This patch moves device registering from pci_bus_add_devices() to
pci_device_add(), which happens earlier, leaving driver attachment in
pci_bus_add_devices().

It also removes unattached child bus handling in pci_bus_add_devices().
That's not needed because child bus via pci_add_new_bus() is already
in parent bus children list.

[bhelgaas: changelog]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/pci/bus.c
drivers/pci/iov.c
drivers/pci/pci.h
drivers/pci/probe.c