diff options
author | Niklas Schnelle <schnelle@linux.ibm.com> | 2021-09-20 09:47:29 +0200 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2022-03-27 22:18:40 +0200 |
commit | 7dcfe50f58d28e0e2ba79e9e4333888bcf9442a4 (patch) | |
tree | 34423420668542f6e45ec87b7d56b933a7d3d91a /arch/s390/pci/pci_bus.h | |
parent | s390/pci: improve zpci_dev reference counting (diff) | |
download | linux-7dcfe50f58d28e0e2ba79e9e4333888bcf9442a4.tar.xz linux-7dcfe50f58d28e0e2ba79e9e4333888bcf9442a4.zip |
s390/pci: rename get_zdev_by_bus() to zdev_from_bus()
Getting a zpci_dev via get_zdev_by_bus() uses the long lived reference
held in zbus->function[devfn]. This is accounted for in
pcibios_add_device() and pcibios_release_device().
Therefore there is no need to increment the reference count in
get_zdev_by_bus() as is done for get_zdev_by_fid(). Instead callers must
not access the device after pcibios_release_device() was called which is
necessary for common PCI code anyway. With this though the very similar
naming may be misleading so rename get_zdev_by_bus() to zdev_from_bus()
emphasizing that we are directly referencing the zdev via the bus.
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/pci/pci_bus.h')
-rw-r--r-- | arch/s390/pci/pci_bus.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/pci/pci_bus.h b/arch/s390/pci/pci_bus.h index ecef3a9e16c0..e96c9860e064 100644 --- a/arch/s390/pci/pci_bus.h +++ b/arch/s390/pci/pci_bus.h @@ -33,8 +33,8 @@ void zpci_free_domain(int domain); int zpci_setup_bus_resources(struct zpci_dev *zdev, struct list_head *resources); -static inline struct zpci_dev *get_zdev_by_bus(struct pci_bus *bus, - unsigned int devfn) +static inline struct zpci_dev *zdev_from_bus(struct pci_bus *bus, + unsigned int devfn) { struct zpci_bus *zbus = bus->sysdata; |