Skip to content

Commit

Permalink
PCI: Move pci_proc_attach_device() to pci_bus_add_device()
Browse files Browse the repository at this point in the history
4f53509 ("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 4f53509.  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>
  • Loading branch information
Yinghai Lu authored and Bjorn Helgaas committed Dec 18, 2013
1 parent e3b439e commit ef37702
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions drivers/pci/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ int pci_bus_add_device(struct pci_dev *dev)
*/
pci_fixup_device(pci_fixup_final, dev);
pci_create_sysfs_dev_files(dev);
pci_proc_attach_device(dev);

dev->match_driver = true;
retval = device_attach(&dev->dev);
Expand Down
2 changes: 0 additions & 2 deletions drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1381,8 +1381,6 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
dev->match_driver = false;
ret = device_add(&dev->dev);
WARN_ON(ret < 0);

pci_proc_attach_device(dev);
}

struct pci_dev *__ref pci_scan_single_device(struct pci_bus *bus, int devfn)
Expand Down

0 comments on commit ef37702

Please sign in to comment.