@@ -292,6 +292,7 @@ int pci_iov_add_virtfn(struct pci_dev *dev, int id)
BUG_ON(rc);
}
+ device_initialize(&virtfn->dev);
pci_device_add(virtfn, virtfn->bus);
rc = pci_iov_sysfs_link(dev, virtfn, id);
if (rc)
@@ -2391,6 +2391,7 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
kfree(dev);
return NULL;
}
+ device_initialize(&dev->dev);
pci_device_add(dev, bus);
return dev;
@@ -2491,7 +2492,6 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
pci_configure_device(dev);
- device_initialize(&dev->dev);
dev->dev.release = pci_release_dev;
set_dev_node(&dev->dev, pcibus_to_node(bus));
Do this so that device_initialize() may be called separately (to prepare for an imminent commit). This change does reverse the invocation of these calls: pci_configure_device(dev); device_initialize(&dev->dev) to device_initialize(&dev->dev) pci_configure_device(dev); I reviewed this and didn't see any issue but it deserves mentioning. Signed-off-by: Jim Quinlan <jim2101024@gmail.com> --- drivers/pci/iov.c | 1 + drivers/pci/probe.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)