]> git.baikalelectronics.ru Git - kernel.git/commit
s390/pci: rename get_zdev_by_bus() to zdev_from_bus()
authorNiklas Schnelle <schnelle@linux.ibm.com>
Mon, 20 Sep 2021 07:47:29 +0000 (09:47 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Sun, 27 Mar 2022 20:18:40 +0000 (22:18 +0200)
commit141dba23e33463cb00ab504a5f2af05391a92c89
tree34423420668542f6e45ec87b7d56b933a7d3d91a
parente533c87ecd2e0473a605a1c4be75ea001de12a46
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>
arch/s390/pci/pci.c
arch/s390/pci/pci_bus.h