sound: bt87x: use pci_status_get_and_clear_errors
authorHeiner Kallweit <hkallweit1@gmail.com>
Sat, 29 Feb 2020 22:29:07 +0000 (23:29 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Mar 2020 22:21:00 +0000 (14:21 -0800)
Use new helper pci_status_get_and_clear_errors() to simplify the code.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
sound/pci/bt87x.c

index 8c48864c844accdc68e69d64eaa0ee780414a631..6567504665b9bc44160e0630ae265148a6b55a04 100644 (file)
@@ -271,13 +271,8 @@ static void snd_bt87x_free_risc(struct snd_bt87x *chip)
 
 static void snd_bt87x_pci_error(struct snd_bt87x *chip, unsigned int status)
 {
-       u16 pci_status;
+       int pci_status = pci_status_get_and_clear_errors(chip->pci);
 
-       pci_read_config_word(chip->pci, PCI_STATUS, &pci_status);
-       pci_status &= PCI_STATUS_PARITY | PCI_STATUS_SIG_TARGET_ABORT |
-               PCI_STATUS_REC_TARGET_ABORT | PCI_STATUS_REC_MASTER_ABORT |
-               PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_DETECTED_PARITY;
-       pci_write_config_word(chip->pci, PCI_STATUS, pci_status);
        if (pci_status != PCI_STATUS_DETECTED_PARITY)
                dev_err(chip->card->dev,
                        "Aieee - PCI error! status %#08x, PCI status %#04x\n",