hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/pci/vc.c
....@@ -13,6 +13,8 @@
1313 #include <linux/pci_regs.h>
1414 #include <linux/types.h>
1515
16
+#include "pci.h"
17
+
1618 /**
1719 * pci_vc_save_restore_dwords - Save or restore a series of dwords
1820 * @dev: device
....@@ -105,7 +107,7 @@
105107 struct pci_dev *link = NULL;
106108
107109 /* Enable VCs from the downstream device */
108
- if (!dev->has_secondary_link)
110
+ if (!pci_is_pcie(dev) || !pcie_downstream_port(dev))
109111 return;
110112
111113 ctrl_pos = pos + PCI_VC_RES_CTRL + (res * PCI_CAP_VC_PER_VC_SIZEOF);
....@@ -170,7 +172,6 @@
170172 * @dev: device
171173 * @pos: starting position of VC capability (VC/VC9/MFVC)
172174 * @save_state: buffer for save/restore
173
- * @name: for error message
174175 * @save: if provided a buffer, this indicates what to do with it
175176 *
176177 * Walking Virtual Channel config space to size, save, or restore it
....@@ -409,7 +410,6 @@
409410 * For each type of VC capability, VC/VC9/MFVC, find the capability, size
410411 * it, and allocate a buffer for save/restore.
411412 */
412
-
413413 void pci_allocate_vc_save_buffers(struct pci_dev *dev)
414414 {
415415 int i;