aboutsummaryrefslogtreecommitdiff
path: root/arch/s390/pci/pci.c
diff options
context:
space:
mode:
authorNiklas Schnelle <[email protected]>2021-02-11 14:20:03 +0100
committerHeiko Carstens <[email protected]>2021-04-12 12:46:41 +0200
commitfaf29a4d93a98b4ccd8a10297353a9d0779d231f (patch)
tree2156f4af74e0b07a5850fc5ae448dfaa517357fb /arch/s390/pci/pci.c
parent6f8daa2953ecd1e8e853939f2007b4160591b8a6 (diff)
s390/pci: introduce zpci_bus_scan_device()
To match zpci_bus_scan_device() and the PCI common code terminology and to remove some code duplication, we pull the multiple uses of pci_scan_single_device() into a function. For now this has the side effect of adding each device to the PCI bus separately and locking and unlocking the rescan/remove lock for each instead of just once per bus. This is clearly less efficient but provides a correct intermediate behavior until a follow on change does both the adding and scanning only once per bus. Reviewed-by: Matthew Rosato <[email protected]> Acked-by: Pierre Morel <[email protected]> Signed-off-by: Niklas Schnelle <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
Diffstat (limited to 'arch/s390/pci/pci.c')
-rw-r--r--arch/s390/pci/pci.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index dd14641b2d20..0bce6078bfd6 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -757,7 +757,6 @@ error:
*/
int zpci_configure_device(struct zpci_dev *zdev, u32 fh)
{
- struct pci_dev *pdev;
int rc;
zdev->fh = fh;
@@ -777,14 +776,10 @@ int zpci_configure_device(struct zpci_dev *zdev, u32 fh)
if (!zdev->zbus->bus)
return 0;
- pdev = pci_scan_single_device(zdev->zbus->bus, zdev->devfn);
- if (!pdev)
+ rc = zpci_bus_scan_device(zdev);
+ if (rc)
goto error_disable;
- pci_bus_add_device(pdev);
- pci_lock_rescan_remove();
- pci_bus_add_devices(zdev->zbus->bus);
- pci_unlock_rescan_remove();
return 0;
error_disable: