diff options
author | Zhao, Yu <yu.zhao@intel.com> | 2008-10-13 07:18:07 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-10-20 13:54:29 -0400 |
commit | 557848c3c03ad1d1e66cb3b5b06698e3a9ebc33c (patch) | |
tree | f244d69c332d3bbbef9f924fb1f0892abba7e1ff /drivers/pci/pci.c | |
parent | 022edd86d7c864bc8fadc3c8ac4e6a464472ab05 (diff) |
PCI: replace cfg space size (256/4096) by macros.
This is a cleanup that changes all PCI configuration space size
representations to the macros (PCI_CFG_SPACE_SIZE and
PCI_CFG_SPACE_EXP_SIZE). And the macros are also moved from
drivers/pci/probe.c to drivers/pci/pci.h.
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 09dc893c81db..553ca6657955 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -213,10 +213,13 @@ int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap) | |||
213 | int pci_find_ext_capability(struct pci_dev *dev, int cap) | 213 | int pci_find_ext_capability(struct pci_dev *dev, int cap) |
214 | { | 214 | { |
215 | u32 header; | 215 | u32 header; |
216 | int ttl = 480; /* 3840 bytes, minimum 8 bytes per capability */ | 216 | int ttl; |
217 | int pos = 0x100; | 217 | int pos = PCI_CFG_SPACE_SIZE; |
218 | 218 | ||
219 | if (dev->cfg_size <= 256) | 219 | /* minimum 8 bytes per capability */ |
220 | ttl = (PCI_CFG_SPACE_EXP_SIZE - PCI_CFG_SPACE_SIZE) / 8; | ||
221 | |||
222 | if (dev->cfg_size <= PCI_CFG_SPACE_SIZE) | ||
220 | return 0; | 223 | return 0; |
221 | 224 | ||
222 | if (pci_read_config_dword(dev, pos, &header) != PCIBIOS_SUCCESSFUL) | 225 | if (pci_read_config_dword(dev, pos, &header) != PCIBIOS_SUCCESSFUL) |
@@ -234,7 +237,7 @@ int pci_find_ext_capability(struct pci_dev *dev, int cap) | |||
234 | return pos; | 237 | return pos; |
235 | 238 | ||
236 | pos = PCI_EXT_CAP_NEXT(header); | 239 | pos = PCI_EXT_CAP_NEXT(header); |
237 | if (pos < 0x100) | 240 | if (pos < PCI_CFG_SPACE_SIZE) |
238 | break; | 241 | break; |
239 | 242 | ||
240 | if (pci_read_config_dword(dev, pos, &header) != PCIBIOS_SUCCESSFUL) | 243 | if (pci_read_config_dword(dev, pos, &header) != PCIBIOS_SUCCESSFUL) |