Skip to content

Commit 2864a88

Browse files
hkallweitdavem330
authored andcommitted
r8169: use pci_status_get_and_clear_errors
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>
1 parent ec5d9e8 commit 2864a88

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4357,13 +4357,15 @@ static void rtl8169_pcierr_interrupt(struct net_device *dev)
43574357
{
43584358
struct rtl8169_private *tp = netdev_priv(dev);
43594359
struct pci_dev *pdev = tp->pci_dev;
4360-
u16 pci_status, pci_cmd;
4360+
int pci_status_errs;
4361+
u16 pci_cmd;
43614362

43624363
pci_read_config_word(pdev, PCI_COMMAND, &pci_cmd);
4363-
pci_read_config_word(pdev, PCI_STATUS, &pci_status);
43644364

4365-
netif_err(tp, intr, dev, "PCI error (cmd = 0x%04x, status = 0x%04x)\n",
4366-
pci_cmd, pci_status);
4365+
pci_status_errs = pci_status_get_and_clear_errors(pdev);
4366+
4367+
netif_err(tp, intr, dev, "PCI error (cmd = 0x%04x, status_errs = 0x%04x)\n",
4368+
pci_cmd, pci_status_errs);
43674369

43684370
/*
43694371
* The recovery sequence below admits a very elaborated explanation:
@@ -4380,11 +4382,6 @@ static void rtl8169_pcierr_interrupt(struct net_device *dev)
43804382

43814383
pci_write_config_word(pdev, PCI_COMMAND, pci_cmd);
43824384

4383-
pci_write_config_word(pdev, PCI_STATUS,
4384-
pci_status & (PCI_STATUS_DETECTED_PARITY | PCI_STATUS_PARITY |
4385-
PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_REC_MASTER_ABORT |
4386-
PCI_STATUS_REC_TARGET_ABORT | PCI_STATUS_SIG_TARGET_ABORT));
4387-
43884385
rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
43894386
}
43904387

0 commit comments

Comments
 (0)