PCI/AER: Factor out ERR_NONFATAL status bit clearing
authorOza Pawandeep <poza@codeaurora.org>
Thu, 19 Jul 2018 22:58:06 +0000 (17:58 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 20 Jul 2018 20:27:09 +0000 (15:27 -0500)
aer_error_resume() clears all ERR_NONFATAL error status bits.  This is
exactly what pci_cleanup_aer_uncorrect_error_status(), so use that instead
of duplicating the code.

Signed-off-by: Oza Pawandeep <poza@codeaurora.org>
[bhelgaas: split to separate patch]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pcie/aer.c

index f853e72524be569d06554878383d862a879c79ce..4411ada4a91cc7848cf3d9953b2181b6ca350917 100644 (file)
@@ -1532,20 +1532,13 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev)
  */
 static void aer_error_resume(struct pci_dev *dev)
 {
-       int pos;
-       u32 status, mask;
        u16 reg16;
 
        /* Clean up Root device status */
        pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &reg16);
        pcie_capability_write_word(dev, PCI_EXP_DEVSTA, reg16);
 
-       /* Clean AER Root Error Status */
-       pos = dev->aer_cap;
-       pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, &status);
-       pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_SEVER, &mask);
-       status &= ~mask; /* Clear corresponding nonfatal bits */
-       pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, status);
+       pci_cleanup_aer_uncorrect_error_status(dev);
 }
 
 static struct pcie_port_service_driver aerdriver = {