Skip to content

Commit ef37702

Browse files
Yinghai Lubjorn-helgaas
authored andcommitted
PCI: Move pci_proc_attach_device() to pci_bus_add_device()
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>
1 parent e3b439e commit ef37702

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

drivers/pci/bus.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ int pci_bus_add_device(struct pci_dev *dev)
176176
*/
177177
pci_fixup_device(pci_fixup_final, dev);
178178
pci_create_sysfs_dev_files(dev);
179+
pci_proc_attach_device(dev);
179180

180181
dev->match_driver = true;
181182
retval = device_attach(&dev->dev);

drivers/pci/probe.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,8 +1381,6 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
13811381
dev->match_driver = false;
13821382
ret = device_add(&dev->dev);
13831383
WARN_ON(ret < 0);
1384-
1385-
pci_proc_attach_device(dev);
13861384
}
13871385

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

0 commit comments

Comments
 (0)