mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 06:14:39 +01:00
PCI: Export pci_dev_trylock() and pci_dev_unlock()
Other places in the kernel use this form, and so just provide a common path for it. Acked-by: Bjorn Helgaas <[email protected]> Signed-off-by: Luis Chamberlain <[email protected]> Reviewed-by: Cornelia Huck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
This commit is contained in:
1 parent
0af5160edb
commit
e3a9b1212b
2 files changed
+7
-2
No files matched your search
+4
-2
@@ -5028,7 +5028,7 @@ static void pci_dev_lock(struct pci_dev *dev)
|
||||
}
|
||||
|
||||
/* Return 1 on successful lock, 0 on contention */
|
||||
static int pci_dev_trylock(struct pci_dev *dev)
|
||||
int pci_dev_trylock(struct pci_dev *dev)
|
||||
{
|
||||
if (pci_cfg_access_trylock(dev)) {
|
||||
if (device_trylock(&dev->dev))
|
||||
@@ -5038,12 +5038,14 @@ static int pci_dev_trylock(struct pci_dev *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pci_dev_trylock);
|
||||
|
||||
static void pci_dev_unlock(struct pci_dev *dev)
|
||||
void pci_dev_unlock(struct pci_dev *dev)
|
||||
{
|
||||
device_unlock(&dev->dev);
|
||||
pci_cfg_access_unlock(dev);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pci_dev_unlock);
|
||||
|
||||
static void pci_dev_save_and_disable(struct pci_dev *dev)
|
||||
{
|
||||
|
||||
@@ -1621,6 +1621,9 @@ void pci_cfg_access_lock(struct pci_dev *dev);
|
||||
bool pci_cfg_access_trylock(struct pci_dev *dev);
|
||||
void pci_cfg_access_unlock(struct pci_dev *dev);
|
||||
|
||||
int pci_dev_trylock(struct pci_dev *dev);
|
||||
void pci_dev_unlock(struct pci_dev *dev);
|
||||
|
||||
/*
|
||||
* PCI domain support. Sometimes called PCI segment (eg by ACPI),
|
||||
* a PCI domain is defined to be a set of PCI buses which share
|
||||
|
||||
Reference in new issue
Block a user