diff options
author | Yinghai Lu <yinghai@kernel.org> | 2013-11-30 17:40:28 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-12-18 15:53:38 -0500 |
commit | ef37702eb3cae2ec35d56ddd4f096cd47fec3f0d (patch) | |
tree | e63a77a09c38648f8dfb14db02499183e1b77568 | |
parent | e3b439e1d315aff59c1b4f0fc43c5cd2d82b4138 (diff) |
PCI: Move pci_proc_attach_device() to pci_bus_add_device()
4f535093cf8f ("PCI: Put pci_dev in device tree as early as possible")
moved pci_proc_attach_device() from pci_bus_add_device() to
pci_device_add().
This moves it back to pci_bus_add_device(), essentially reverting that
part of 4f535093cf8f. This makes it symmetric with pci_stop_dev(),
where we call pci_proc_detach_device() and pci_remove_sysfs_dev_files()
and set dev->is_added = 0.
[bhelgaas: changelog, create sysfs then attach proc for symmetry]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | drivers/pci/bus.c | 1 | ||||
-rw-r--r-- | drivers/pci/probe.c | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index fc1b74013743..a037d81f21ed 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c | |||
@@ -176,6 +176,7 @@ int pci_bus_add_device(struct pci_dev *dev) | |||
176 | */ | 176 | */ |
177 | pci_fixup_device(pci_fixup_final, dev); | 177 | pci_fixup_device(pci_fixup_final, dev); |
178 | pci_create_sysfs_dev_files(dev); | 178 | pci_create_sysfs_dev_files(dev); |
179 | pci_proc_attach_device(dev); | ||
179 | 180 | ||
180 | dev->match_driver = true; | 181 | dev->match_driver = true; |
181 | retval = device_attach(&dev->dev); | 182 | retval = device_attach(&dev->dev); |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 38e403dddf6e..173a9cf4593e 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -1381,8 +1381,6 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus) | |||
1381 | dev->match_driver = false; | 1381 | dev->match_driver = false; |
1382 | ret = device_add(&dev->dev); | 1382 | ret = device_add(&dev->dev); |
1383 | WARN_ON(ret < 0); | 1383 | WARN_ON(ret < 0); |
1384 | |||
1385 | pci_proc_attach_device(dev); | ||
1386 | } | 1384 | } |
1387 | 1385 | ||
1388 | struct pci_dev *__ref pci_scan_single_device(struct pci_bus *bus, int devfn) | 1386 | struct pci_dev *__ref pci_scan_single_device(struct pci_bus *bus, int devfn) |