device/pci_ops: Define pci_find_capability() just once

Wrap the simple romstage implementation to be called
from ramstage.

Change-Id: Iadadf3d550416850d6c37233bd4eda025f4d3960
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/31755
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/include/device/pci_ops.h b/src/include/device/pci_ops.h
index 454795f..9a9c575 100644
--- a/src/include/device/pci_ops.h
+++ b/src/include/device/pci_ops.h
@@ -175,4 +175,21 @@
 	pci_write_config32(dev, reg, reg32);
 }
 
+u16 pci_s_find_next_capability(pci_devfn_t dev, u16 cap, u16 last);
+u16 pci_s_find_capability(pci_devfn_t dev, u16 cap);
+
+#ifndef __SIMPLE_DEVICE__
+static __always_inline
+u16 pci_find_next_capability(const struct device *dev, u16 cap, u16 last)
+{
+	return pci_s_find_next_capability(PCI_BDF(dev), cap, last);
+}
+
+static __always_inline
+u16 pci_find_capability(const struct device *dev, u16 cap)
+{
+	return pci_s_find_capability(PCI_BDF(dev), cap);
+}
+#endif
+
 #endif /* PCI_OPS_H */