aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/pci.c67
-rw-r--r--drivers/pci/pcie/aer/aerdrv_acpi.c2
-rw-r--r--include/linux/pci.h2
3 files changed, 1 insertions, 70 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index aeda6e9c245c..a23b071798f6 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -136,30 +136,6 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar)
136EXPORT_SYMBOL_GPL(pci_ioremap_bar); 136EXPORT_SYMBOL_GPL(pci_ioremap_bar);
137#endif 137#endif
138 138
139#if 0
140/**
141 * pci_max_busnr - returns maximum PCI bus number
142 *
143 * Returns the highest PCI bus number present in the system global list of
144 * PCI buses.
145 */
146unsigned char __devinit
147pci_max_busnr(void)
148{
149 struct pci_bus *bus = NULL;
150 unsigned char max, n;
151
152 max = 0;
153 while ((bus = pci_find_next_bus(bus)) != NULL) {
154 n = pci_bus_max_busnr(bus);
155 if(n > max)
156 max = n;
157 }
158 return max;
159}
160
161#endif /* 0 */
162
163#define PCI_FIND_CAP_TTL 48 139#define PCI_FIND_CAP_TTL 48
164 140
165static int __pci_find_next_cap_ttl(struct pci_bus *bus, unsigned int devfn, 141static int __pci_find_next_cap_ttl(struct pci_bus *bus, unsigned int devfn,
@@ -329,49 +305,6 @@ int pci_find_ext_capability(struct pci_dev *dev, int cap)
329} 305}
330EXPORT_SYMBOL_GPL(pci_find_ext_capability); 306EXPORT_SYMBOL_GPL(pci_find_ext_capability);
331 307
332/**
333 * pci_bus_find_ext_capability - find an extended capability
334 * @bus: the PCI bus to query
335 * @devfn: PCI device to query
336 * @cap: capability code
337 *
338 * Like pci_find_ext_capability() but works for pci devices that do not have a
339 * pci_dev structure set up yet.
340 *
341 * Returns the address of the requested capability structure within the
342 * device's PCI configuration space or 0 in case the device does not
343 * support it.
344 */
345int pci_bus_find_ext_capability(struct pci_bus *bus, unsigned int devfn,
346 int cap)
347{
348 u32 header;
349 int ttl;
350 int pos = PCI_CFG_SPACE_SIZE;
351
352 /* minimum 8 bytes per capability */
353 ttl = (PCI_CFG_SPACE_EXP_SIZE - PCI_CFG_SPACE_SIZE) / 8;
354
355 if (!pci_bus_read_config_dword(bus, devfn, pos, &header))
356 return 0;
357 if (header == 0xffffffff || header == 0)
358 return 0;
359
360 while (ttl-- > 0) {
361 if (PCI_EXT_CAP_ID(header) == cap)
362 return pos;
363
364 pos = PCI_EXT_CAP_NEXT(header);
365 if (pos < PCI_CFG_SPACE_SIZE)
366 break;
367
368 if (!pci_bus_read_config_dword(bus, devfn, pos, &header))
369 break;
370 }
371
372 return 0;
373}
374
375static int __pci_find_next_ht_cap(struct pci_dev *dev, int pos, int ht_cap) 308static int __pci_find_next_ht_cap(struct pci_dev *dev, int pos, int ht_cap)
376{ 309{
377 int rc, ttl = PCI_FIND_CAP_TTL; 310 int rc, ttl = PCI_FIND_CAP_TTL;
diff --git a/drivers/pci/pcie/aer/aerdrv_acpi.c b/drivers/pci/pcie/aer/aerdrv_acpi.c
index 275bf158ffa7..124f20ff11b2 100644
--- a/drivers/pci/pcie/aer/aerdrv_acpi.c
+++ b/drivers/pci/pcie/aer/aerdrv_acpi.c
@@ -59,7 +59,7 @@ static int aer_hest_parse(struct acpi_hest_header *hest_hdr, void *data)
59 59
60 p = (struct acpi_hest_aer_common *)(hest_hdr + 1); 60 p = (struct acpi_hest_aer_common *)(hest_hdr + 1);
61 if (p->flags & ACPI_HEST_GLOBAL) { 61 if (p->flags & ACPI_HEST_GLOBAL) {
62 if ((info->pci_dev->is_pcie && 62 if ((pci_is_pcie(info->pci_dev) &&
63 info->pci_dev->pcie_type == pcie_type) || bridge) 63 info->pci_dev->pcie_type == pcie_type) || bridge)
64 ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST); 64 ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST);
65 } else 65 } else
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 8c8b44d62105..27da5ce46282 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -718,8 +718,6 @@ enum pci_lost_interrupt_reason pci_lost_interrupt(struct pci_dev *dev);
718int pci_find_capability(struct pci_dev *dev, int cap); 718int pci_find_capability(struct pci_dev *dev, int cap);
719int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap); 719int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap);
720int pci_find_ext_capability(struct pci_dev *dev, int cap); 720int pci_find_ext_capability(struct pci_dev *dev, int cap);
721int pci_bus_find_ext_capability(struct pci_bus *bus, unsigned int devfn,
722 int cap);
723int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); 721int pci_find_ht_capability(struct pci_dev *dev, int ht_cap);
724int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); 722int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap);
725struct pci_bus *pci_find_next_bus(const struct pci_bus *from); 723struct pci_bus *pci_find_next_bus(const struct pci_bus *from);