lkml.org 
[lkml]   [2021]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v6 3/9] PCI: move pci_device_add() call
Date
Move call to pci_device_add() from pci_scan_single_device() to
pci_scan_device(). No other functions call pci_scan_device() so
this should be harmless.

Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
---
drivers/pci/probe.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index d9fc02a71baa..f3fc807b4fe8 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2391,6 +2391,7 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
kfree(dev);
return NULL;
}
+ pci_device_add(dev, bus);

return dev;
}
@@ -2540,13 +2541,7 @@ struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn)
return dev;
}

- dev = pci_scan_device(bus, devfn);
- if (!dev)
- return NULL;
-
- pci_device_add(dev, bus);
-
- return dev;
+ return pci_scan_device(bus, devfn);
}
EXPORT_SYMBOL(pci_scan_single_device);

--
2.17.1
\
 
 \ /
  Last update: 2021-10-29 22:04    [W:0.562 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site