/* Returns the address of the requested capability structure within the device's PCI configuration space or 0 in case the device does not support it.  */
int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap)
/* Returns the address of the requested capability structure within the device's PCI configuration space or 0 in case the device does not support it.  */
int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap)
{
	int pos;
	u8 hdr_type;
	pci_bus_read_config_byte(bus, devfn, PCI_HEADER_TYPE, &hdr_type);
	pos = __pci_bus_find_cap_start(bus, devfn, hdr_type & 0x7f);
	if (pos)
		pos = __pci_find_next_cap(bus, devfn, pos, cap);
	return pos;
}