diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2020-02-29 23:24:23 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-04 14:21:00 -0800 |
commit | ec5d9e87842a43be3a10ada0d5f560bbd3f31d5d (patch) | |
tree | e340fc0b992a0dfc1e44f696f033d1419b4e0666 /include/linux/pci.h | |
parent | d6e055e8733da5ce53fc69c77e379915400068c5 (diff) | |
download | lwn-ec5d9e87842a43be3a10ada0d5f560bbd3f31d5d.tar.gz lwn-ec5d9e87842a43be3a10ada0d5f560bbd3f31d5d.zip |
PCI: Add pci_status_get_and_clear_errors
Several drivers use the following code sequence:
1. Read PCI_STATUS
2. Mask out non-error bits
3. Action based on error bits set
4. Write back set error bits to clear them
As this is a repeated pattern, add a helper to the PCI core.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 101d71e0ad0d..7beaf51e98ec 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1210,6 +1210,7 @@ int pci_select_bars(struct pci_dev *dev, unsigned long flags); bool pci_device_is_present(struct pci_dev *pdev); void pci_ignore_hotplug(struct pci_dev *dev); struct pci_dev *pci_real_dma_dev(struct pci_dev *dev); +int pci_status_get_and_clear_errors(struct pci_dev *pdev); int __printf(6, 7) pci_request_irq(struct pci_dev *dev, unsigned int nr, irq_handler_t handler, irq_handler_t thread_fn, void *dev_id, |