summaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
Diffstat (limited to 'src/device')
-rw-r--r--src/device/device_util.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/device/device_util.c b/src/device/device_util.c
index 0be6cfbf36..6919f4bb39 100644
--- a/src/device/device_util.c
+++ b/src/device/device_util.c
@@ -965,3 +965,18 @@ bool is_enabled_cpu(const struct device *cpu)
{
return is_cpu(cpu) && cpu->enabled;
}
+
+bool is_pci(const struct device *pci)
+{
+ return pci->path.type == DEVICE_PATH_PCI;
+}
+
+bool is_enabled_pci(const struct device *pci)
+{
+ return is_pci(pci) && pci->enabled;
+}
+
+bool is_pci_dev_on_bus(const struct device *pci, unsigned int bus)
+{
+ return is_pci(pci) && pci->bus->secondary == bus;
+}