aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2012-06-13 19:04:51 -0400
committerBjorn Helgaas <bhelgaas@google.com>2012-06-13 19:04:51 -0400
commit10c480933d0ad2ea27630cbaa723a5d33dbece00 (patch)
tree6938c675ca99e1204d701b4fb60af89d381beeff /drivers
parenta187177ae047e005a7b40229555837a529a9c2cc (diff)
parent505cf30b7f4ef64c6db36f34adbe4a7ad9081fd3 (diff)
Merge branch 'topic/bjorn-remove-unused' into next
* topic/bjorn-remove-unused: PCI/AER: use pci_is_pcie() instead of obsolete pci_dev.is_pcie PCI: remove pci_max_busnr() (was already commented out) PCI: remove pci_bus_find_ext_capability() (unused)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/pci.c67
-rw-r--r--drivers/pci/pcie/aer/aerdrv_acpi.c2
2 files changed, 1 insertions, 68 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